StringUtils
Public Static Methods
| Return | Name | Description |
|---|---|---|
size_t | split static | Split string by delimiter with optional trimming. |
size_t | split static | Split string by single character delimiter (faster) |
std::string | trim static | Trim whitespace from both ends. |
std::string | ltrim static | Trim whitespace from left. |
std::string | rtrim static | Trim whitespace from right. |
std::string | join static | Join strings with delimiter. |
std::string | to_lower static | Convert string to lowercase. |
std::string | to_upper static | Convert string to uppercase. |
bool | starts_with static | Check if string starts with prefix. |
bool | ends_with static | Check if string ends with suffix. |
bool | contains static | Check if string contains substring. |
std::string | replace_all static | Replace all occurrences of ‘from’ with ‘to’. |
void | split_respecting_quotes static | Split keeping quoted sections intact. |
std::string | remove_whitespace static | Remove all whitespace from string. |
std::string | pad_left static | Pad string to width with fill character. |
std::string | pad_right static | |
std::string | escape_json static | Escape special characters for JSON. |
split
static
Parameters
-
sInput string -
resultOutput vector (appends to existing elements) -
delimDelimiter string -
keep_emptyKeep empty tokens -
trim_spaceTrim whitespace from each token
Returns
Number of characters processed Example:split
static
trim
static
ltrim
static
rtrim
static
join
static
to_lower
static
to_upper
static
starts_with
static
ends_with
static
contains
static
replace_all
static
split_respecting_quotes
static
remove_whitespace
static
pad_left
static
pad_right
static
escape_json
static