I wrote the following test which uses "\\d" as the delimeter:
And the output is shown below
I was suprised by the empty tokens. For example why are there emptry tokens at index 0 and 1 but none between 2 and 3 even though there is a number between 2 and 3? Or why there are no empty tokens after token 20?
And also, is there a way to access the "current index" value when using the ehanced for loop? (I had to manually declare int i=0 as shown above).
Thanks
And the output is shown below
I was suprised by the empty tokens. For example why are there emptry tokens at index 0 and 1 but none between 2 and 3 even though there is a number between 2 and 3? Or why there are no empty tokens after token 20?
And also, is there a way to access the "current index" value when using the ehanced for loop? (I had to manually declare int i=0 as shown above).
Thanks