title: How to verify if a string.split() returns null
body: <p>I am reading data from a file:</p>
  
  <pre><code>Some Name;1|IN03PLF;IN02SDI;IN03MAP;IN02SDA;IN01ARC
  Some Other Name;2|IN01ALG;IN01ANZ
  Another Name;3|
  Test Testson;4|IN03MAP;IN01ARC;IN01ALG
  </code></pre>
  
  <p>I use string.split() for every line I read from that file, like this:</p>
  
  <pre><code>String args[]         = line.split("\\|");                  
  String candidatArgs[] = args[0].split(";");
  
  if (args[1] != "" || args[1] != null) { 
  
      String inscrieriString[] = args[1].split(";");
  </code></pre>
  
  <p><strong>Thing is:</strong> when I reach <code>Another Name;3|</code> after <code>.split("\\|")</code> the second part (<code>args[1]</code>) should be empty, either <code>null</code> or <code>""</code>  (I don't really know).</p>
  
  <p><strong>However</strong> I get an Array index out of bounds error on <code>if (args[1] != "" || args[1] != null)</code> (again, at: <code>Another Name;3|</code>)</p>