The OpenD Programming Language

splitter

Lazily splits the character-based range s into words, using whitespace as the delimiter.

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

Parameters

s Range

The character-based range to be split. Must be a string, or a random-access range of character types.

Return Value

Type: auto

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

Examples

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

Meta