Lines Matching defs:str
143 std::vector<std::string> SplitString(const std::string &str, const std::string del)
149 found = str.find_first_of(del, start);
150 result.push_back(str.substr(start, found - start));
159 std::string Trim(const std::string &str)
161 if (str.empty()) {
162 LOG(ERROR) << "str is empty";
163 return str;
166 size_t end = str.size() - 1;
167 while (start < str.size()) {
168 if (!isspace(str[start])) {
174 if (!isspace(str[end])) {
182 return str.substr(start, end - start + 1);
800 return oss.str();
927 void GetTagValInStr(const std::string &str, const std::string &tag, std::string &val)
929 if (str.find(tag + "=") != std::string::npos) {
930 val = str.substr(str.find("=") + 1, str.size() - str.find("="));
934 bool IsValidHexStr(const std::string &str)
936 for (const auto &ch : str) {
944 void TrimString(std::string &str)
946 auto pos = str.find_last_not_of("\r\n");
948 str.erase(pos + 1, str.size() - pos);