title: split method of class String ignores semicolon separators
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/545957/java-split-method-strips-empty-strings-at-the-end">Java split() method strips empty strings at the end?</a>  </p>
  </blockquote>
  
  
  
  <p>In Java, I'm using the String split method to split a string containing values separated by semicolons.</p>
  
  <p>Currently, I have the following line that works in 99% of all cases.</p>
  
  <pre><code>String[] fields = optionsTxt.split(";");
  </code></pre>
  
  <p>When using following String everything is perfect:</p>
  
  <pre><code>"House;Car;Street;Place" =&gt; [House] [Car] [Street] [Place]
  </code></pre>
  
  <p>But when i use following String, split Method ignores the last two semicolons.</p>
  
  <pre><code>"House;Car;;" =&gt; [House][Car]
  </code></pre>
  
  <p>What's wrong? Or is there any workaround?</p>