Thanks Chandra.
I completely understand the limits concept. But have a few doubts in the examples.
Input "boo:and:foo"
But, after "b" why do we get just a single empty string "" and not 2 empty strings.
As o is applied as the regex pattern, should we not get 2 empty strings:
1. "" from start index = 1 to end index = 1
2. "" from start index = 2 to end index = 2
Just like in the end ":and:f" is followed by 2 empty strings.
Also, if the above case would be true then the array length can only be 5, so our output would be
{ "b", "", "", ":and:f", "" }
where the last empty string contains both the last 2 empty strings as per javadoc.
[ May 24, 2007: Message edited by: Gautam Arora ]