Lines Matching refs:str
34 void StringUtil::Split(const string &str, const string &sep, vector<string> &res)
37 string tmpStr = str;
54 std::vector<string> StringUtil::StringSplit(string &str, const string &pattern)
58 str += pattern;
59 unsigned int size = str.size();
62 pos = str.find(pattern, i);
64 string s = str.substr(i, pos - i);
83 return oss.str();
86 void StringUtil::TrimSpecialChars(string &str)
90 while (sp < str.size()) {
91 size_t ep = str.find_first_of(" \t\n\v\f\r,.:;!~@#$%^&*()`?/-+", sp);
93 str.erase(ep, 1);
101 uint32_t StringUtil::CalSubStrNum(const string &str, const string &subStr)
108 pos = str.find(subStr, pos);
112 pos = str.find(subStr, pos);
143 bool StringUtil::StringToInt(const std::string &str, int32_t &val)
146 long int conVal = std::strtol(str.c_str(), &endStr, 10); // decimal
147 if (conVal == LONG_MAX || conVal == LONG_MIN || endStr == nullptr || endStr == str.c_str() || *endStr != '\0') {