Add Strings::split() function
MODIFY
include/vcpkg_Strings.h
include/vcpkg_Strings.h
@@ -75,4 +75,6 @@ namespace vcpkg::Strings
std::string trimmed(const std::string& s);
void trim_all_and_remove_whitespace_strings(std::vector<std::string>* strings);
+
+ std::vector<std::string> split(const std::string& s, const std::string& delimiter);
}

MODIFY
src/vcpkg_Strings.cpp
src/vcpkg_Strings.cpp
@@ -119,4 +119,25 @@ namespace vcpkg::Strings
return s == "";
}), strings->end());
}
+
+ std::vector<std::string> split(const std::string& s, const std::string& delimiter)
+ {
+ std::vector<std::string> output;
+
+ size_t i = 0;
+ size_t pos = s.find(delimiter);
+ while (pos != std::string::npos)
+ {
+ output.push_back(s.substr(i, pos - i));
+ i = ++pos;
+ pos = s.find(delimiter, pos);
+
+ if (pos == std::string::npos)
+ {
+ output.push_back(s.substr(i, s.length()));
+ }
+ }
+
+ return output;
+ }
}

Add Strings::split() function