title: Java : split a string that containing special characters
body: <p>I have a string like <code>||81|||01||</code> and I want to split the string with <code>|</code> symbol.</p>
  
  <p>I had done this way,</p>
  
  <pre><code>String str = "||81|||01||";
  System.out.println(str .split("\\|").length); //printing 6 . But I am expecting 8
  </code></pre>
  
  <p>what is wrong with this code? | How can I split this string with that character so that I will get expected length (<code>8</code>)?;</p>