split

fnS[] split(S)(S s) if (isSomeString!S) @safe pure

Eagerly splits range into an array, using sep as the delimiter.

When no delimiter is provided, strings are split into an array of words, using whitespace as delimiter. Runs of whitespace are merged together (no empty words are produced).

The range must be a forward range. The separator can be a value of the same type as the elements in range or it can be another forward range.

Parameters

sthe string to split by word if no separator is given
rangethe range to split
sepa value of the same type as the elements of range or another
isTerminatora predicate that splits the range when it returns true.

Returns

An array containing the divided parts of range (or the words of s).

See Also

splitter for a lazy version without allocating memory. splitter for a version that splits using a regular

expression defined separator.

fnauto split(Range, Separator)(Range range, Separator sep) if (isForwardRange!Range && ( is(typeof(ElementType!Range.init == Separator.init)) || is(typeof(ElementType!Range.init == ElementType!Separator.init)) && isForwardRange!Separator ))

ditto

fnauto split(alias isTerminator, Range)(Range range) if (isForwardRange!Range && is(typeof(unaryFun!isTerminator(range.front))))

ditto