added string functions
This commit is contained in:
@@ -43,7 +43,17 @@ std::vector<std::string> regexp_strsplit(const std::string &string_to_split, con
|
||||
return elems;
|
||||
}
|
||||
|
||||
std::string trim(std::string s, const std::string &chars_to_trim, const std::string &rltrim) {
|
||||
std::string string_lucase(std::string s, const std::string &strcase) {
|
||||
if (strcase == "upper")
|
||||
std::transform(s.begin(), s.end(),s.begin(), ::toupper);
|
||||
|
||||
if (strcase == "lower")
|
||||
std::transform(s.begin(), s.end(),s.begin(), ::tolower);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
std::string string_trim(std::string s, const std::string &chars_to_trim, const std::string &rltrim) {
|
||||
if (rltrim == "ltrim" || rltrim == "trim")
|
||||
s.erase(0, s.find_first_not_of(chars_to_trim));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user