13 std::vector<std::string>
split(
const char* pszString,
const char* splitChars)
15 std::vector<std::string> items;
16 if (splitChars == NULL || *splitChars ==
'\0')
21 const char* workPtr = pszString;
24 size_t foundIndex = strcspn(workPtr, splitChars);
25 if (foundIndex < strlen(workPtr))
27 items.push_back(std::string(workPtr, 0, foundIndex));
28 workPtr += foundIndex + 1;
32 items.push_back(std::string(workPtr));
39 std::vector<std::string>
split(
const std::string& szString,
40 const std::string& splitChars)
42 return split(szString.c_str(), splitChars.c_str());
Declaration of the split functions, for splitting a string on delimiters.
The namespace containing all the "helper" functions in the C++ code.
std::vector< std::string > split(const char *pszString, const char *splitChars)
Split the given string into a list of strings given the character on which to split....