I found a neat way to extract all characters (as Strings) of a string:
String[] chars = "abc".split(""); // "a", "b", "c"
I expected to get a blank first term, but to my surprise it didn't split at start of input, even though a blank matches at start of input - ie between ^
and "a"
.
Conversely, a non-blank regex does match at start:
String[] chars = ";a;b;c".split(";"); // "", "a", "b", "c"
Why does a blank regex not split (ie match) at start of input?