void StringSplit(char delim, const std::string &text, std::vector<std::string> &strings)
{
std::string::size_type current = 0;
while (true)
{
std::string::size_type idx = text.find(delim, current);
if (idx == std::string::npos)
{
std::string slice = text.substr(current);
strings.push_back(slice);
break;
}
std::string slice = text.substr(current, idx - current);
strings.push_back(slice);
current = idx + 1;
}
}
{
std::string::size_type current = 0;
while (true)
{
std::string::size_type idx = text.find(delim, current);
if (idx == std::string::npos)
{
std::string slice = text.substr(current);
strings.push_back(slice);
break;
}
std::string slice = text.substr(current, idx - current);
strings.push_back(slice);
current = idx + 1;
}
}