I have a problem in string.split("|");
the above code not working properly.
i want to split the above string Ganesan and Ramakrishnan.
any suggestion would be appreciated.
This thread discuss the rest ..
Originally posted by Ulf Dittmer:
The important point is that the argument to split is a regular expression, and that in regular expressions certain characters have special meaning, e.g. the "|" symbol. If those are to be used with their literal meaning they need to be escaped, which is done by preceding them with a backslash. Try using "\|".
Of course you need to escape the backslash as well because it's a Java escape character too so it should be "\\|"