Expand description
Multiple String related functions
Enums§
- Remove
Location Enum - Remove Location for remove_char function
Functions§
- contains_
whole_ word - Checks whether a given
haystackstring contains the specifiedwordas a whole word, using word boundaries. - find_
value_ by_ key - Finds and returns the value corresponding to a given key in a vector of key-value pairs.
- generate_
url_ safe_ string - Generates a random URL-safe string of the specified length.
- get_
first_ occurrance - Finds and returns the substring before the first occurrence of a given separator.
- get_
first_ of_ split - Splits the given string at the first occurrence of the specified separator.
- remove_
char - Removes the first or last character of a string if it matches the given target character.
- remove_
first_ n_ characters - The remove_first_n function removes the first n characters from a string slice, returning a new string slice that starts from the character after the nth character. This function properly handles Unicode characters by working with character indices rather than byte indices, ensuring that multi-byte UTF-8 characters are correctly handled.
- remove_
tags - Removes all
<custom> ... </custom>sections from the input string, returning a newStringwith the tags and their contents removed. - split_
upto_ n_ by_ word - Splits a string into at most
nsubstrings, grouped by whole words.