Structs
Extensions
on String
these are the main string utilities of the duck std library
Extension Methods
len
fn() -> Int
returns the length of the string self
count
fn() -> Int
returns the count of actual utf8 runes in the string
is_empty
fn() -> Bool
returns if the string is empty
contains
fn(substr: String) -> Bool
returns if the string contains the given substr
starts_with
fn(prefix: String) -> Bool
returns if the string starts with given prefix
ends_with
fn(suffix: String) -> Bool
returns if the string ends with the given suffix
index_of
fn(substr: String) -> Int | .none
returns the index of the given substr or .none if not found
to_upper
fn() -> String
returns the string in uppercase
to_lower
fn() -> String
returns the string in lowercase
trim
fn() -> String
returns the string with trimmed space at the beginning and end of the string
replace
fn(old_s: String, new_s: String) -> String
returns the string with given old_s replaced with given new_s
substring
fn(start: Int, end: Int) -> String | .err_out_of_bounds
returns a substring of the string
repeat
fn(count: Int) -> String
returns the string repeated
to_int
fn() -> Int | .err_parsing
returns the string as a int or .err_parsing if couldn't parse to int
to_bytes
fn() -> Int[]
returns a byte array of the string
on String
these are the main string utilities of the duck std library
Extension Methods
len
fn() -> Int
returns the length of the string self
count
fn() -> Int
returns the count of actual utf8 runes in the string
is_empty
fn() -> Bool
returns if the string is empty
contains
fn(substr: String) -> Bool
returns if the string contains the given substr
starts_with
fn(prefix: String) -> Bool
returns if the string starts with given prefix
ends_with
fn(suffix: String) -> Bool
returns if the string ends with the given suffix
index_of
fn(substr: String) -> Int | .none
returns the index of the given substr or .none if not found
to_upper
fn() -> String
returns the string in uppercase
to_lower
fn() -> String
returns the string in lowercase
trim
fn() -> String
returns the string with trimmed space at the beginning and end of the string
replace
fn(old_s: String, new_s: String) -> String
returns the string with given old_s replaced with given new_s
substring
fn(start: Int, end: Int) -> String | .err_out_of_bounds
returns a substring of the string
repeat
fn(count: Int) -> String
returns the string repeated
to_int
fn() -> Int | .err_parsing
returns the string as a int or .err_parsing if couldn't parse to int
to_bytes
fn() -> Int[]
returns a byte array of the string
Global Functions
string_____to_int
fn(x: String) -> Int
returns x in uppercase
std_____string_____to_int
fn(x: String) -> Int
returns x in uppercase
No results found matching your search.