[CLJ-1312] clojure.string/split on empty string includes empty string in results Created: 21/Dec/13 Updated: 21/Dec/13 Resolved: 21/Dec/13
|Affects Version/s:||Release 1.5|
Splitting a string using clojure.string/split with an empty regex includes the empty string in the results - is this expected behaviour?
|Comment by Alex Miller [ 21/Dec/13 8:05 AM ]|
Yes, I think so. This is a case where Clojure defers to the host (Java) for behavior. I think the way to interpret this is that the empty pattern matches all strings. Split checks left to right whether there is a next chunk of string that matches the pattern. The empty pattern matches at the beginning to a string of length 0. Something like that.