title: How can split a string which contains only delimiter?
body: <p>I am using the following code:</p>
  
  <pre><code>String sample = "::";
  String[] splitTime = sample.split(":");
  // extra detail omitted
  System.out.println("Value 1 :"+splitTime[0]);
  System.out.println("Value 2 :"+splitTime[1]);
  System.out.println("Value 3 :"+splitTime[2]);
  </code></pre>
  
  <p>I am getting <code>ArrayIndexOutofBound</code> exception.  How does <code>String.split()</code> handle consecutive or trailing / opening delimiters?</p>
  
  <p><strong>See also</strong>:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/785533">Doubt in split method</a></li>
  <li><a href="https://stackoverflow.com/questions/545957">Java split() method strips empty strings at the end?</a></li>
  </ul>