例子:
String s = ":a:b:c:";
s.split(":");
// Output: [, a, b, c]
来自 Java 文档:
The array returned by this method contains each substring of this string that is terminated by another substring that matches the given expression or is terminated by the end of the string.
为什么在没有结束空字符串的地方考虑起始空字符串?起始空字符串以“:”结束,结束空字符串以字符串结尾结束。所以两者都应该列出,不是吗?