scsl
0.1.1
Shimmering Clarity Standard Library
|
namespace S contains string-related functions. More...
Functions | |
void | TrimLeadingWhitespace (std::string &s) |
void | TrimTrailingWhitespace (std::string &s) |
void | TrimWhitespace (std::string &s) |
std::string | TrimLeadingWhitespaceDup (std::string s) |
std::string | TrimTrailingWhitespaceDup (std::string s) |
std::string | TrimWhitespaceDup (std::string s) |
std::vector< std::string > | SplitKeyValuePair (std::string line, std::string delimiter) |
std::vector< std::string > | SplitKeyValuePair (std::string line, char delimiter) |
std::vector< std::string > | SplitN (std::string, std::string delimiter, size_t maxCount=0) |
std::ostream & | VectorToString (std::ostream &os, const std::vector< std::string > &svec) |
Return a string represention of a string vector in the form [size]{"foo", "bar", ...}. | |
std::string | VectorToString (const std::vector< std::string > &svec) |
namespace S contains string-related functions.
std::vector<std::string> scsl::U::S::SplitKeyValuePair | ( | std::string | line, |
char | delimiter | ||
) |
Split a line into key and value pairs. If the delimiter isn't found, the line is returned as the first element in the pair, and the second element will be empty.
line | A string representing a line in a file. |
delimiter | The character delimiter between the key and value. |
std::vector<std::string> scsl::U::S::SplitKeyValuePair | ( | std::string | line, |
std::string | delimiter | ||
) |
Split a line into key and value pairs. If the delimiter isn't found, the line is returned as the first element in the pair, and the second element will be empty.
line | A string representing a line in a file. |
delimiter | The string delimiter between the key and value. |
std::vector< std::string > scsl::U::S::SplitN | ( | std::string | s, |
std::string | delimiter, | ||
size_t | maxCount = 0 |
||
) |
Split a string into parts based on the delimiter.
delimiter | The string that delimits the parts of the string. |
maxCount | The maximum number of parts to split. If 0, there is no limit to the number of parts. |
void scsl::U::S::TrimLeadingWhitespace | ( | std::string & | s | ) |
Remove any whitespace at the beginning of the string. The string is modified in-place.
std::string scsl::U::S::TrimLeadingWhitespaceDup | ( | std::string | s | ) |
Remove any whitespace at the beginning of the string. The original string isn't modified, and a copy is returned.
void scsl::U::S::TrimTrailingWhitespace | ( | std::string & | s | ) |
Remove any whitespace at the end of the string. The string is modified in-place.
std::string scsl::U::S::TrimTrailingWhitespaceDup | ( | std::string | s | ) |
Remove any whitespace at the end of the string. The original string isn't modified, and a copy is returned.
void scsl::U::S::TrimWhitespace | ( | std::string & | s | ) |
Remove any whitespace at the beginning and end of the string. The string is modified in-place.
std::string scsl::U::S::TrimWhitespaceDup | ( | std::string | s | ) |
Remove any whitespace at the beginning and end of the string. The original string isn't modified, and a copy is returned.