9 inline void ltrim(std::string &
s)
12 std::find_if(
s.begin(),
s.end(), [](
unsigned char ch) { return !std::isspace(ch); }));
17 s.erase(std::find_if(
s.rbegin(),
s.rend(), [](
unsigned char ch) { return !std::isspace(ch); })
21 inline void trim(std::string &
s)
44 inline std::string
ToLower(
const std::string &str)
46 std::string lowerStr = str;
47 std::transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(), ::tolower);
52 inline std::string
ToUpper(
const std::string &str)
54 std::string upperStr = str;
55 std::transform(upperStr.begin(), upperStr.end(), upperStr.begin(), ::toupper);
58 inline bool StartsWith(
const std::string &str,
const std::string &prefix)
60 if (str.length() < prefix.length())
64 return str.compare(0, prefix.length(), prefix) == 0;
Definition: AllFlavorsShape.h:14
std::string ToUpper(const std::string &str)
Definition: StringUtils.h:52
void rtrim(std::string &s)
Definition: StringUtils.h:15
std::string trim_copy(std::string s)
Definition: StringUtils.h:39
std::string rtrim_copy(std::string s)
Definition: StringUtils.h:33
@ s
Definition: PartonUtils.h:68
std::string ltrim_copy(std::string s)
Definition: StringUtils.h:27
std::string ToLower(const std::string &str)
Definition: StringUtils.h:44
void ltrim(std::string &s)
Definition: StringUtils.h:9
bool StartsWith(const std::string &str, const std::string &prefix)
Definition: StringUtils.h:58
void trim(std::string &s)
Definition: StringUtils.h:21