Search¶
Constructors¶
create¶
Returns¶
- Search val^
Public Functions¶
contains¶
True iff haystack contains needle as a contiguous byte
subsequence. Empty needle is always contained (returns true).
Parameters¶
Returns¶
- (Bool val | InvalidUtf8 val)
starts_with¶
True iff haystack begins with prefix.
Parameters¶
Returns¶
- (Bool val | InvalidUtf8 val)
ends_with¶
True iff haystack ends with suffix.
Parameters¶
Returns¶
- (Bool val | InvalidUtf8 val)
index_of¶
Byte offset of the first occurrence of needle, or None if
absent. Empty needle returns 0.
fun box index_of(
haystack: String box,
needle: String box)
: (USize val | None val | InvalidUtf8 val)
Parameters¶
Returns¶
- (USize val | None val | InvalidUtf8 val)
last_index_of¶
Byte offset of the last occurrence of needle, or None.
fun box last_index_of(
haystack: String box,
needle: String box)
: (USize val | None val | InvalidUtf8 val)
Parameters¶
Returns¶
- (USize val | None val | InvalidUtf8 val)
count¶
Non-overlapping occurrences of needle in haystack.
Parameters¶
Returns¶
- (USize val | InvalidUtf8 val)
eq¶
Parameters¶
- that: Search val
Returns¶
- Bool val
ne¶
Parameters¶
- that: Search val
Returns¶
- Bool val