Jest to kontynuacja do this question.Zachowanie dzielenia łańcucha na pusty łańcuch i pojedynczy łańcuch ogranicznika
Pytanie znajduje się w drugiej linii poniżej.
"".split("x"); //returns {""} // ok
"x".split("x"); //returns {} but shouldn't it return {""} because it's the string before "x" ?
"xa".split("x"); //returns {"", "a"} // see?, here "" is the first string returned
"ax".split("x"); //returns {"a"}
patrz [SI-5096] (https://issues.scala-lang.org/browse/SI-5069) "Bug in split(), gdy ograniczniki występować na końcu łańcucha" – 4e6
Dlatego Google Guava utworzył com.google.common.base.Splitter – Schildmeijer