Function liberate::string::split

Function Documentation

std::vector<std::string> liberate::string::split(std::string const &haystack, std::string const &delimiters = " \t\n")

Split a string by delimiter character(s). Any sequence of delimiters is taken as a single delimiter, i.e. if the second parameter is “;,”, a haystack of “foo,;bar” yields two results. There is no third result representing the empty string between the delimiters.

Parameters
  • haystack[in] The haystack to process.

  • delimiters[in] The delimiter characters at which to split the string; each character is treated as an equivalent delimiter to the others. This defaults to spaces, tabs and newlines.

Returns

a std::vector of the split parts.