splitW method
Implementation
Iterable<String> splitW(String sep) sync* {
if (!contains(sep)) {
yield this;
return;
}
List<String> pieces = split(sep);
for (int i = 0; i < pieces.length; i++) {
if (i == pieces.length - 1) {
yield pieces[i];
} else {
yield "${pieces[i]}$sep";
}
}
if (pieces.isEmpty) {
yield this;
}
}