Originally posted by Khaled Mahmoud:
Is this a bug in the split function in the String object.
No. The parameter you pass to the split method is a regular expression and | is a special character in regular expressions. If you don't want it to be regarded as a special character you need to escape it. Note however that the escape character (\) is a special character in
Java Strings, so you need to escape that as well. Try