Try the following:
String[] = "abcde|12345|xyz".split("|");
The results will not be as expected (at least I ..).
Using any other character looks fine.
String[] = "abcde,12345,xyz".split(",");
So what's so special about the pipe?
Java String.split () expects RegExp and the pipe character to have a special value in RegExps, except for a comma. Try the following:
String[] = "abcde|12345|xyz".split("\\|");
The split method expects a regular expression, and "|" is a special symbol in the world of regular expressions: http://www.tutorialspoint.com/java/java_string_split.htm
split
Source: https://habr.com/ru/post/1501981/More articles:Responsive CSS Design - Large or Small Screen to Launch - performanceCAGradientLayer does not work on iOS 7 (but works on iOS 6) - iosHow to enable only one button and make user interaction No - iosNameGen () function: attempt to compare nil with number - randomSelecting a column in a text area - javascriptLimitations for Indexed Addressing - assemblyHow does CreateProcess () know that a new process is going through a subsystem? - windowsDo% work on the βstartβ or βendβ in the SQL block - vimcreating simulation input files using Python - pythonKeyboard key for storing Azure tables - azureAll Articles