title: Split function not working properly
body: <p>I am trying to split the string using <strong>Split</strong> function in java</p>
  
  <pre><code>String empName="employee name | employee Email";
  String[] empDetails=empName.split("|");
  </code></pre>
  
  <p>it gives me result as</p>
  
  <pre><code>empDetails[0]="e";
  empDetails[1]="m";
  empDetails[2]="p";
  empDetails[3]="l";
  empDetails[4]="o";
  empDetails[5]="y";
  empDetails[6]="e";
  empDetails[7]="e";
  .
  .
  .
  </code></pre>
  
  <p>but when i try following code</p>
  
  <pre><code>String empName="employee name - employee Email";
  String[] empDetails=empName.split("-");
  </code></pre>
  
  <p>it gives me</p>
  
  <pre><code> empDetails[0]="employee name ";
   empDetails[1]=" employee Email";
  </code></pre>
  
  <p>why java split function can not split the string seperated by "|"</p>