![]() |
General Utility Library for C++17 25.4.1
|
Trimming whitespace from strings.
Functions | |
GUL_EXPORT std::string | gul17::trim (std::string_view str, std::string_view ws_chars=default_whitespace_characters) |
Trim leading and trailing whitespace (or a custom set of characters) from a string, returning a new std::string. | |
GUL_EXPORT std::string_view | gul17::trim_sv (std::string_view str, std::string_view ws_chars=default_whitespace_characters) |
Trim leading and trailing whitespace (or a custom set of characters) from a string, returning a view into the original string. | |
GUL_EXPORT std::string | gul17::trim_left (std::string_view str, std::string_view ws_chars=default_whitespace_characters) |
Trim leading whitespace (or a custom set of characters) from a string, returning a new std::string. | |
GUL_EXPORT std::string_view | gul17::trim_left_sv (std::string_view str, std::string_view ws_chars=default_whitespace_characters) |
Trim leading whitespace (or a custom set of characters) from a string, returning a view into the original string. | |
GUL_EXPORT std::string | gul17::trim_right (std::string_view str, std::string_view ws_chars=default_whitespace_characters) |
Trim trailing whitespace (or a custom set of characters) from a string, returning a new std::string. | |
GUL_EXPORT std::string_view | gul17::trim_right_sv (std::string_view str, std::string_view ws_chars=default_whitespace_characters) |
Trim trailing whitespace (or a custom set of characters) from a string, returning a view into the original string. | |
std::string gul17::trim | ( | std::string_view | str, |
std::string_view | ws_chars = default_whitespace_characters |
||
) |
Trim leading and trailing whitespace (or a custom set of characters) from a string, returning a new std::string.
Which characters are removed can be customized via the ws_chars parameter.
str | The string that should be trimmed. |
ws_chars | A string containing all the characters that should be treated as whitespace (i.e. that are trimmed). If this is empty, no characters are trimmed. |
References gul17::bit_set(), and gul17::trim_sv().
std::string gul17::trim_left | ( | std::string_view | str, |
std::string_view | ws_chars = default_whitespace_characters |
||
) |
Trim leading whitespace (or a custom set of characters) from a string, returning a new std::string.
Which characters are removed can be customized via the ws_chars parameter.
str | The string from which leading characters should be trimmed. |
ws_chars | A string containing all the characters that should be treated as whitespace (i.e. that are trimmed). If this is empty, no characters are trimmed. |
References gul17::bit_set(), and gul17::trim_left_sv().
std::string_view gul17::trim_left_sv | ( | std::string_view | str, |
std::string_view | ws_chars = default_whitespace_characters |
||
) |
Trim leading whitespace (or a custom set of characters) from a string, returning a view into the original string.
Which characters are removed can be customized via the ws_chars parameter.
str | The string from which leading characters should be trimmed. |
ws_chars | A string containing all the characters that should be treated as whitespace (i.e. that are trimmed). If this is empty, no characters are trimmed. |
References gul17::bit_set().
Referenced by gul17::trim_left().
std::string gul17::trim_right | ( | std::string_view | str, |
std::string_view | ws_chars = default_whitespace_characters |
||
) |
Trim trailing whitespace (or a custom set of characters) from a string, returning a new std::string.
Which characters are removed can be customized via the ws_chars parameter.
str | The string from which trailing characters should be trimmed. |
ws_chars | A string containing all the characters that should be treated as whitespace (i.e. that are trimmed). If this is empty, no characters are trimmed. |
References gul17::bit_set(), and gul17::trim_right_sv().
std::string_view gul17::trim_right_sv | ( | std::string_view | str, |
std::string_view | ws_chars = default_whitespace_characters |
||
) |
Trim trailing whitespace (or a custom set of characters) from a string, returning a view into the original string.
Which characters are removed can be customized via the ws_chars parameter.
str | The string from which trailing characters should be trimmed. |
ws_chars | A string containing all the characters that should be treated as whitespace (i.e. that are trimmed). If this is empty, no characters are trimmed. |
References gul17::bit_set().
Referenced by gul17::trim_right().
std::string_view gul17::trim_sv | ( | std::string_view | str, |
std::string_view | ws_chars = default_whitespace_characters |
||
) |
Trim leading and trailing whitespace (or a custom set of characters) from a string, returning a view into the original string.
Which characters are removed can be customized via the ws_chars parameter.
str | The string that should be trimmed. |
ws_chars | A string containing all the characters that should be treated as whitespace (i.e. that are trimmed). If this is empty, no characters are trimmed. |
References gul17::bit_set().
Referenced by gul17::trim().