A simpler way to allow trim() to work with temporary strings.
This commit is contained in:
@@ -74,19 +74,17 @@ namespace wagic
|
||||
|
||||
using std::string;
|
||||
|
||||
#define SPACES " \t\r\n"
|
||||
//string manipulation methods
|
||||
|
||||
// for trimming strings on the fly
|
||||
string trim (const string & s, const string & t = SPACES);
|
||||
string trim_right (const string & s, const string & t = SPACES);
|
||||
string trim_left (const string & s, const string & t = SPACES);
|
||||
|
||||
// trimmning strings inplace
|
||||
string& trim(string& str);
|
||||
string& ltrim(string& str);
|
||||
string& rtrim(string& str);
|
||||
|
||||
inline string trim(const string& str)
|
||||
{
|
||||
string value(str);
|
||||
return trim(value);
|
||||
}
|
||||
|
||||
std::string join(vector<string>& v, string delim = " ");
|
||||
|
||||
std::vector<std::string>& split(const std::string& s, char delim, std::vector<std::string>& elems);
|
||||
|
||||
Reference in New Issue
Block a user