title: Java split stops at white space while using | as delimiter
body: <p>I am splitting a String with split() but I don't know why it stops when it reaches a whitespace. Here is the code:</p>
  
  <pre><code>String a = "R|1|^^^fieldname1|18.8H |||||||||";
  
  String[] b = a.split(Pattern.quote("|"));
  also tried
  String[] b = a.split("\\|");
  
  System.out.println("Array length :"+b.length);
  </code></pre>
  
  <p>Output is : 4</p>
  
  <p>I could not find a reason behind this please suggest me what am I missing.</p>