I am trying to split the string using Split function in java
String empName=\"employee name | employee Email\"; String[] empDetails=empName.
Try
String[] empDetails=empName.split("\\|");