I have a String = \"Hello-new-World\". And when i use the split() method with different regex values, it acts differently.
String str = \"Hello-new-world\" Strin
The pipe has different meaning in regular expression, so if you want to use it you need to escape the special character.
str.split("\\|");