Possible Duplicate:
Java split() method strips empty strings at the end?

The split method of String class does not include trailing empty strings in the array it returns. How do I get past this restriction:

class TestRegex{
 public static void main(String...args){
  String s = "a:b:c:";    
  String [] pieces = s.split(":");

  System.out.println(pieces.length); // prints 3...I want 4.
 }
}
Edit
Report