gossamer/string
Values
pub fn char_code_at(
string: String,
index index: Int,
) -> Result(Int, Nil)
pub fn code_point_at(
string: String,
index index: Int,
) -> Result(Int, Nil)
pub fn ends_with_within(
string: String,
suffix suffix: String,
within length: Int,
) -> Bool
pub fn from_char_code(code: Int) -> String
pub fn from_char_codes(codes: List(Int)) -> String
pub fn from_code_point(code: Int) -> Result(String, String)
Returns an error if the code point is invalid.
pub fn from_code_points(
codes: List(Int),
) -> Result(String, String)
Returns an error if any code point is invalid.
pub fn includes_from(
in string: String,
search search: String,
from position: Int,
) -> Bool
pub fn index_of_from(
in string: String,
search search: String,
from position: Int,
) -> Int
pub fn is_well_formed(string: String) -> Bool
pub fn last_index_of(
in string: String,
search search: String,
) -> Int
pub fn last_index_of_from(
in string: String,
search search: String,
from position: Int,
) -> Int
pub fn length(of string: String) -> Int
Returns the number of UTF-16 code units. This differs from
gleam/string.length which counts grapheme clusters.
pub fn locale_compare(
string: String,
to other: String,
) -> order.Order
pub fn normalize(string: String) -> String
Returns the NFC-normalized form of the string.
pub fn normalize_with(
string: String,
form form: normalization_form.NormalizationForm,
) -> String
pub fn pad_end(
string: String,
to target_length: Int,
with pad: String,
) -> String
Pads the end to reach target_length UTF-16 code units. This differs
from gleam/string.pad_end which counts grapheme clusters.
pub fn pad_start(
string: String,
to target_length: Int,
with pad: String,
) -> String
Pads the start to reach target_length UTF-16 code units. This differs
from gleam/string.pad_start which counts grapheme clusters.
pub fn replace(
in string: String,
pattern pattern: String,
with replacement: String,
) -> String
Replaces the first occurrence only. Use replace_all to replace every
occurrence.
pub fn replace_all(
in string: String,
pattern pattern: String,
with replacement: String,
) -> String
pub fn split_with_limit(
string: String,
on separator: String,
limit limit: Int,
) -> List(String)
pub fn starts_with(string: String, prefix prefix: String) -> Bool
pub fn starts_with_from(
string: String,
prefix prefix: String,
from position: Int,
) -> Bool
pub fn to_locale_lower_case(string: String) -> String
pub fn to_locale_upper_case(string: String) -> String
pub fn to_lower_case(string: String) -> String
pub fn to_upper_case(string: String) -> String
pub fn to_well_formed(string: String) -> String
pub fn trim_start(string: String) -> String