String
A list of characters representing text.
THP strings are...
Common operations
- Op 1
- Op 2: ref
val name = "hello"
FUNCTIONS
fun to_lowercase(self) -> String
Clones the string as lowercase
fun to_uppercase(self) -> String
Clones the string as uppercase
fun len(self) -> u64
Returns the length of the string, in UTF-8 code units
fun size(self) -> u64
Returns the number of bytes of the string
fun split(self, split_char: u8) -> Array[String]
Splits the array by `split_char`
fun bytes(self) -> Array[u8]
Returns an array with the bytes of the string
fun from_bytes(self, bytes: Array[u8]) -> !String
Returns an array with the bytes of the string
fun replace_once(self, needle: String, _: String) -> B) -> String
Creates a new string with the first occurence replaced
fun is_empty(self) -> Bool
Returns true if the string is empty