isPartitionOf

Returns true iff parts is a partition of whole. This is equivalent to join(parts) == whole but more efficient.

pure nothrow @safe @nogc
bool
isPartitionOf
(
T
)
(
const T[][] parts
,
const T[] whole
)

Examples

enum text = "lorem ipsum dolor sit amet";
enum words = [
    text[0 .. 5],
    text[5 .. 6],
    text[6 .. 11],
    text[11 .. 12],
    text[12 .. 17],
    text[17 .. 18],
    text[18 .. 21],
    text[21 .. 22],
    text[22 .. 26],
];

assert(words.isPartitionOf(text));

Meta