title: How to split a string in java with a specified delimiter while ignoring /?
body: <p>I tried to read about regex and escaping, but no luck. </p>
  
  <p>I have a string that looks like this:</p>
  
  <pre><code>String s = "4/18/2015|Planned|Linux|Maintenance";
  </code></pre>
  
  <p>And I want to split it with the delimiter '|' :</p>
  
  <pre><code>String[] tokens = s.split("|");
  </code></pre>
  
  <p>The correct results I am expecting which are </p>
  
  <pre><code>tokens[0] is "4/18/2015", 
  tokens[1] is "Planned", 
  tokens[2] is "Linux", 
  token[3] is "Maintenance", 
  </code></pre>
  
  <p>yet it's giving me some weird result like this:</p>
  
  <pre><code>tokens[0] is null
  tokens[1] is 4
  tokens[2] is /
  and tokens[3] is 1
  </code></pre>
  
  <p>I am guessing it's because of the slashes '/' in the date that's why. I tried to search for many existing questions and tried the suggested methods as well but to no avail.</p>