Sachin Adat wrote:
Abhi vijay wrote:But, If I change the input String to
a1a2a34a56789aaa, still the noof tokens generated is 5. Why so??
What's the explanation to this?
Hi Sachin,
Actually
public String[] split(String regex) invokes the overloaded method public String[] split(String regex,
int limit)[/b] with limit 0.
If the limit is zero then the regex pattern will be applied as many times as possible, the array can have any length, and
trailing empty strings will be discarded.
Yuan