Module string

Module string 

Source
Expand description

String utility functions for text processing

Constants§

HASH_BASIS
HASH_PRIME
FNV-1a hash constants

Functions§

build_dir_entry_path
Constructs a full path for a directory entry with appropriate separators
build_file_entry_path
Constructs a full path for a file entry with appropriate separators
ends_with
Check if a string ends with a specific suffix
find_str
Find the position of a substring in a string
hash
Hash a string using FNV-1a algorithm
hash_compile_time
Alias for hash_const to match C++ naming pattern
hash_const
Compile-time version of the hash function
join
Join a slice of strings with a separator
join_path
Joins two path segments with a proper separator. Makes sure there’s exactly one ‘/’ between segments.
md5
Calculate MD5 hash for a string
normalize_dir_path
Normalize a directory path to ensure it ends with a slash
normalize_file_path
Normalize a file path to ensure it starts with a slash when needed
remove_emoji
Removes emoji characters from a string using a regular expression.
replace_all_distinct
Replace all occurrences of a string with another
starts_with
Check if a string starts with a specific prefix
to_lower
Convert a string to lowercase
trim
Trim whitespace from the beginning and end of a string
trim_of
Trim a specific character from the beginning and/or end of a string
trim_whitespace