title: Java split by a successive character
body: <p>I have the following example, to explain better what i'm trying to do:</p>
  
  <pre><code>String text = "a,b,,,,c,,";
  String[] split = text.split(",");
  for(int i=0;i&lt;split.length;i++){
      System.out.println("I = "+i+" "+split[i]);
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>I = 0 a
  
  I = 1 b
  
  I = 2 
  
  I = 3 
  
  I = 4 
  
  I = 5 c
  </code></pre>
  
  <p>But, what i want is to get an array of size 8, containing also:</p>
  
  <pre><code>I = 6 
  
  I = 7
  </code></pre>
  
  <p>Of course, the last 2 elements will be empty strings, but it is essential for me to get them. Also, i think it's logical to have them. I mean, if i had:</p>
  
  <pre><code>String text = "a,b,,,,c,,d";
  </code></pre>
  
  <p>The result would be an array of size 8 and i don't think there is a big difference between the 2 examples.</p>