Thursday, 12 September 2013

Why does single pipe character confuse java split method?

Why does single pipe character confuse java split method?

Try the following:
String[] = "abcde|12345|xyz".split("|");
The results will not be as (at least I..) anticipated.
Using any other character seems to be ok.
String[] = "abcde,12345,xyz".split(",");
So what is special with the pipe?

No comments:

Post a Comment