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
An unescaped | is parsed as a regex meaning "empty string or empty string," so use
|
str.split("\\|");
| having special meaning OR in regex