char[][] split(char[] string, char[] pattern, char[] attributes = null)
|
Split string into an array of strings, using regular expression pattern with attributes as the separator.
Example:
import std.stdio;
import std.regexp;
int main() {
char[] str = "You can, if you want, split on any|pattern";
char[][] words = split(str,"[,| ]+");
foreach(word; words) {
writefln("%s",word);
}
return 0;
}
|
Output:
You
can
if
you
want
split
on
any
pattern |
|