General Utility Library for C++14
2.11
|
Trimming whitespace from strings.
Functions | |
GUL_EXPORT std::string | gul14::trim (string_view str, 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. More... | |
GUL_EXPORT string_view | gul14::trim_sv (string_view str, 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. More... | |
GUL_EXPORT std::string | gul14::trim_left (string_view str, string_view ws_chars=default_whitespace_characters) |
Trim leading whitespace (or a custom set of characters) from a string, returning a new std::string. More... | |
GUL_EXPORT string_view | gul14::trim_left_sv (string_view str, 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. More... | |
GUL_EXPORT std::string | gul14::trim_right (string_view str, string_view ws_chars=default_whitespace_characters) |
Trim trailing whitespace (or a custom set of characters) from a string, returning a new std::string. More... | |
GUL_EXPORT string_view | gul14::trim_right_sv (string_view str, 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. More... | |
std::string gul14::trim | ( | string_view | str, |
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 gul14::trim_sv().
std::string gul14::trim_left | ( | string_view | str, |
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 gul14::trim_left_sv().
string_view gul14::trim_left_sv | ( | string_view | str, |
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. |
Referenced by gul14::trim_left().
std::string gul14::trim_right | ( | string_view | str, |
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 gul14::trim_right_sv().
string_view gul14::trim_right_sv | ( | string_view | str, |
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. |
Referenced by gul14::trim_right().
string_view gul14::trim_sv | ( | string_view | str, |
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. |
Referenced by gul14::trim().