resulting slices buffer
input string
delimiter character
maximum number of slices; set to 0 to indicate no limit
set to true to collapse consecutive occurrences to prevent producing empty "slices"
the resulting slices
cstring[] slices; test!("==")(StringSearch!().split(slices, "a;b;c", ';'), ["a", "b", "c"][]); test!("==")(StringSearch!().split(slices, "a;b;c", '.'), ["a;b;c"][]); test!("==")(StringSearch!().split(slices, "abc;", ';'), ["abc", ""][]); test!("==")(StringSearch!().split(slices, ";abc;", ';'), ["", "abc", ""][]); test!("==")(StringSearch!().split(slices, "a;;bc", ';'), ["a", "", "bc"][]); test!("==")(StringSearch!().split(slices, "a;b;c", ';', 2), ["a", "b"][]); test!("==")(StringSearch!().split(slices, "abc;", ';', 0, true), ["abc"][]); test!("==")(StringSearch!().split(slices, ";abc;", ';', 0, true), ["abc"][]); test!("==")(StringSearch!().split(slices, "a;;bc", ';', 0, true), ["a", "bc"][]); mstring[] mslices; test!("==")(StringSearch!().split(slices, "a;b;c".dup, ';'), ["a", "b", "c"][]);
Splits str into at most n slices on each occurrence of delim. collapse indicates whether to collapse consecutive occurrences to a single one to prevent producing empty slices.