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 froms
at delimiterd
. The delimiter is not included in the strings. Adjacent delimiters do not produce empty strings in the returned vector. Up tocount
entries will be in the returned vector. e.g."a.b..c.dee."
would produce{ "a", "b", "c", "dee" }
assuming thatd
is.
andcount
is >= 4.