Split the provided array wherever a pattern instance is found, and return the resultant segments. The pattern is excluded from each of the segments.
Note that the src content is not duplicated by this function, but is sliced instead.
(Adapted from ocean.text.Util : split, which isn't memory safe.)
Template params: T = type of array element
source array to split
pattern to split array by
receives split array segments (slices into src)
result
Buffer!(cstring) result; split("aaa..bbb..ccc", "..", result); test!("==")(result[], [ "aaa", "bbb", "ccc" ]);
See Implementation
Split the provided array wherever a pattern instance is found, and return the resultant segments. The pattern is excluded from each of the segments.
Note that the src content is not duplicated by this function, but is sliced instead.
(Adapted from ocean.text.Util : split, which isn't memory safe.)
Template params: T = type of array element