bySlice

Returns an input range consisting of the input argument sliced by group of length len.

bySlice
(
Range
)
(
auto ref Range range
,
size_t len
)
if (
isInputRange!Range &&
isSomeChar!(ElementType!Range)
)

Examples

auto text = "AABBCCDD";
assert(text.bySlice(2).array == ["AA","BB","CC","DD"]);
auto str = "AAE";
assert(str.bySlice(2).array == ["AA","E"]);

Meta