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 adaptor for a pair of iterators.
| Name | Description |
|---|---|
| Str | Represent a constant reference to a string, i.e. a character array and a length, which need not be null terminated. |
| Separator | Represent a constant reference to a string, i.e. a character array and a length, which need not be null terminated. |