Crate bt_string_utils

Crate bt_string_utils 

Source
Expand description

Multiple String related functions

Enums§

RemoveLocationEnum
Remove Location for remove_char function

Functions§

contains_whole_word
Checks whether a given haystack string contains the specified word as 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 new String with the tags and their contents removed.
split_upto_n_by_word
Splits a string into at most n substrings, grouped by whole words.