Lines Matching refs:str
61 bool StartsWith(const std::string &str, const std::string &prefix)
63 return ((str.size() > prefix.size()) && (str.substr(0, prefix.size()) == prefix));
66 bool EndsWith(const std::string &str, const std::string &suffix)
68 return ((str.size() > suffix.size()) && (str.substr(str.size() - suffix.size(), suffix.size()) == suffix));
71 std::string Trim(const std::string &str)
74 size_t end = str.size() - 1;
76 while (start < str.size()) {
77 if (!isspace(str[start])) {
84 if (!isspace(str[end])) {
94 return str.substr(start, end - start + 1);
97 std::vector<std::string> Split(const std::string &str, const std::string &pattern)
103 pos = str.find_first_of(pattern, start);
104 result.push_back(str.substr(start, pos - start));