Iterate over partitions of a string split on Separator.
Declared in <llvm/ADT/StringExtras.h>
iterator_range<SplittingIterator>
split(
StringRef Str,
StringRef Separator);
Used to permit conveniently iterating over separated strings like so:
for (StringRef x : llvm::split("foo,bar,baz", ","))
...;
Note that the passed string must remain valid throughout lifetime of the iterators.
A range of partitions of Str.
| Name | Description |
|---|---|
| Str | string to partition |
| Separator | multi-character delimiter |