splitter

Lazily splits the string s into words, using whitespace as the delimiter.

This function is string specific and, contrary to splitter!(std.uni.isWhite), runs of whitespace will be merged together (no empty tokens will be produced).

Parameters

s
Type: C[]

The string to be split.

Return Value

Type: auto

An input range of slices of the original string split by whitespace.

Examples

import std.algorithm.comparison : equal;
auto a = " a     bcd   ef gh ";
assert(equal(splitter(a), ["a", "bcd", "ef", "gh"][]));

Meta