String Text¶
Import: import system.text;
last_index_of¶
The index of the last occurrence of substring sub, or None. Empty sub is Some(length). Byte-compare scan like index_of — allocates nothing per candidate.
replace_first¶
Replaces the first occurrence of old with replacement.
split_once¶
Splits at the first occurrence of sep into exactly two parts. When sep does not occur, returns [this] (consistent with split), never an empty array.
split_once¶
Splits at the first occurrence of sep; returns a one-element array when no separator is found.
strip_prefix¶
Some remainder when this starts with prefix.
strip_suffix¶
Some remainder when this ends with suffix.
lines¶
Iterates over the lines without copying them. Lines end at \n; a trailing \r is dropped from each line, and a final line terminator does not produce an empty line. Call to_string() on a line to keep an owned copy.
repeat¶
A new string repeated times times.
equals¶
Value equality (Equatable<string>); identical to this == other.
split¶
Splits this string on the single character sep.
split¶
Splits this string on every occurrence of substring sep.
split¶
Splits on sep into at most limit parts (limit < 1 means no limit).
split¶
Splits on sep into at most limit parts (limit < 1 means no limit).
replace¶
A new string with every occurrence of old replaced by replacement.