![]() |
User Guide
|
string utility functions More...
string utility functions
Enumerations | |
enum | text_alignment { text_alignment::left, text_alignment::right, text_alignment::center } |
text alignment when printing in the tabular form More... | |
Functions | |
std::string | to_string (double value, const std::string &format_spec="{:.16g}") |
Convert double value to string without trailing zeros. More... | |
std::string | join_arguments (const std::string &lhs, const std::string &rhs) |
Joint two (list of) arguments. More... | |
static std::string | ltrim (std::string text) |
static std::string | rtrim (std::string text) |
static std::string | trim (std::string text) |
static std::string | remove_character (std::string text, const char c) |
Remove all occurrences of a given character in a text. More... | |
static std::string | trim_newline (std::string text) |
static std::string | escape_quotes (const std::string &text) |
Escape double-quote in a text, useful for JSON pretty printer. More... | |
static std::vector< std::string > | split_string (const std::string &text, char delimiter) |
Split a text in a list of words, using a given delimiter character. More... | |
static bool | ends_with (const std::string &haystack, const std::string &needle) |
Check if haystack ends with needle . More... | |
static bool | starts_with (const std::string &haystack, const std::string &needle) |
Check if haystack starts with needle . More... | |
static std::string | align_text (const std::string &text, int width, text_alignment type) |
Aligns a text within a field of width width. More... | |
static std::string | tolower (std::string text) |
To lower case. More... | |