|
|
static bool | startsWith (const std::string &s, const std::string &substring) |
| |
|
static bool | endsWith (const std::string &s, const std::string &substring) |
| |
| static std::string & | upperCase (std::string &s, size_t n=std::numeric_limits< size_t >::max()) |
| | Turns n first characters uppercase. ASCII only.
|
| |
|
static char | upperCase (char c) |
| | Turns a character to uppercase. ASCII only.
|
| |
| static std::string & | lowerCase (std::string &s, size_t n=std::numeric_limits< size_t >::max()) |
| | Turns n first characters lowercase. ASCII only.
|
| |
|
static char | lowerCase (char c) |
| | Turns a character to lowercase. ASCII only.
|
| |
| static void | replace (const std::string &src, char search, char repl, std::ostream &ostr) |
| | Replaces instances of 'search' to 'repl' in src.
|
| |
|
static void | replace (const std::string &src, char from, char repl, std::string &dst) |
| | In src, replaces instances of 'search' to 'repl', storing the result in dst.
|
| |
|
template<typename S , typename R > |
| static void | replace (const std::string &src, const S &search, const R &repl, std::ostream &ostr) |
| | In src, replaces instances of 'search' to 'repl', storing the result in dst.
|
| |
|
template<typename T1 , typename T2 > |
| static void | replace (const std::string &src, const T1 &search, const T2 &repl, std::string &dst) |
| | In src, replaces instances of 'from' to 'to', storing the result in dst.
|
| |
| template<typename T > |
| static void | replace (const std::string &src, const std::map< char, T > &m, std::ostream &ostr) |
| | Convenience using copying of string.
|
| |
|
template<typename T > |
| static void | replace (const std::string &src, const std::map< char, T > &m, std::string &dst) |
| |
|
static void | replace (const std::string &src, const std::map< char, char > &m, std::string &dst) |
| | NEW Fast (in-place) implementation of char-to-char replace.
|
| |
| template<class K , class V > |
| static void | replace (const std::string &src, const std::map< K, V > &m, std::string &dst) |
| |
|
template<class K , class V > |
| static void | replace (const std::string &src, const std::initializer_list< std::pair< K, V > > &m, std::string &dst) |
| |
|
static std::string | trim (const std::string &s, const std::string &trimChars=" \t\n\r") |
| | Returns a string without leading and trailing whitespace (or str undesired chars).
|
| |
| static std::string | trimSymmetric (const std::string &s, const std::string &leading="'\"", const std::string &trailing="") |
| | Coupled trimming: remove a single leading and trailing char, if both found.
|
| |
| static bool | trimScan (const std::string &s, size_t &pos1, size_t &pos2, const std::string &trimChars=" \t\n") |
| | Returns indices to trimmed segment of s such that it can be extracted as s.substr(pos1, pos2-pos1).
|
| |
| template<class T , class C > |
| static void | split (const std::string &s, T &sequence, const C &separators, const std::string &trimChars=" \t\n") |
| | Splits and trims a given std::string to a std Sequence.
|
| |
| template<class T1 , class T2 , class C > |
| static bool | split2 (const std::string &s, T1 &first, T2 &second, const C &separators, const std::string &trimChars=" \t\n") |
| | Splits and trims a given std::string to a std Sequence.
|
| |
| static size_t | extractPrefixLength (const std::string &src1, const std::string &src2, size_t step=1) |
| | Determine the length of a common leading part, rounding up the result with step.
|
| |
| static size_t | extractPrefix (const std::string &src1, const std::string &src2, std::string &prefix, std::string &dst1, std::string &dst2, size_t step=1) |
| | Extract common leading part, truncating the source strings.
|
| |
| static size_t | extractPrefix (std::string &s1, std::string &s2, std::string &prefix, size_t step=1) |
| | Extract common leading part, truncating the input strings.
|
| |
| template<class T > |
| static std::ostream & | join (const T &container, std::ostream &ostr, char separator=0) |
| | Writes a STL Container (list, vector, set) to a stream, using an optional separator char (e.g. ',').
|
| |
| template<class T > |
| static std::string | join (T &container, char separator=0) |
| | Writes a STL Container (list, vector, set) to a string, using an optional separator char (like ',').
|
| |
|
template<unsigned int S> |
| static void | read (std::istream &istr, std::string &s) |
| | Read input stream and append it to s.
|
| |
| template<class T > |
| static void | convert (const std::string &s, T &dst) |
| | Conversion from std::string to basic types, including std::string.
|
| |
| template<class T > |
| static T | convert (const std::string &s) |
| | Conversion from std::string to basic types, including std::string.
|
| |
|
template<class T > |
| static std::string & | import (const T &src, std::string &target) |
| |
| template<class T > |
| static const T & | lazyConvert (const std::string &s, T &tmp) |
| | Convert only if needed. If T is std::string, returns s directly.
|
| |