omni::extras::split

Defined in omni/extras/StringHelpers.h

inline std::vector<std::string> omni::extras::split(const std::string &s, char d, size_t count = std::numeric_limits<size_t>::max())

Splits a string based on a delimiter.

Parameters
  • s – The string to split

  • d – The delimiter character

  • count – The maximum number of sections to split s into

Returns

a std::vector of strings that have been split from s at delimiter d. The delimiter is not included in the strings. Adjacent delimiters do not produce empty strings in the returned vector. Up to count entries will be in the returned vector. e.g. "a.b..c.dee." would produce { "a", "b", "c", "dee" } assuming that d is . and count is >= 4.