Lines Matching defs:source
97 std::string StringReplace(std::string source, const std::string &from, const std::string &to)
102 while ((pos = source.find(from)) != std::string::npos) {
104 result.append(source.substr(0, pos) + to);
105 source.erase(0, pos + from.length());
108 result.append(source);
112 size_t SubStringCount(const std::string &source, const std::string &sub)
117 return source.size();
119 while ((pos = source.find(sub, pos)) != std::string::npos) {
126 std::vector<std::string> StringSplit(std::string source, const std::string &split)
133 while ((pos = source.find(split)) != std::string::npos) {
135 std::string token = source.substr(0, pos);
139 source.erase(0, pos + split.length());
143 if (!source.empty()) {
144 result.push_back(source);