Lines Matching defs:source
34 std::string StringReplace(std::string source, const std::string &from, const std::string &to)
39 while ((pos = source.find(from)) != std::string::npos) {
41 result.append(source.substr(0, pos) + to);
42 source.erase(0, pos + from.length());
45 result.append(source);
49 size_t SubStringCount(const std::string &source, const std::string &sub)
54 return source.size();
56 while ((pos = source.find(sub, pos)) != std::string::npos) {
63 std::vector<std::string> StringSplit(std::string source, std::string split)
70 while ((pos = source.find(split)) != std::string::npos) {
72 std::string token = source.substr(0, pos);
76 source.erase(0, pos + split.length());
80 if (!source.empty()) {
81 result.push_back(source);