When I want to split the String "aaaa|bbbbb|123456" with the method String.split("|"), the result is unexpected .
My code:
String s = "aaaa|bbbbb|123456";
String[] temp = s.split("|");
for (String str:temp) {
System.out.println(str);
}
But the result is:
a
a
a
a
|
b
b
b
b
b
|
1
2
3
4
5
6
are there anything special with char "|" ?