If counter has a value of 11, counter+1 will be 12
Add a println to print out the value of counter inside the loop to see what its value is. Be sure to print it out every time its value is changed.
Type: Posts; User: Norm
If counter has a value of 11, counter+1 will be 12
Add a println to print out the value of counter inside the loop to see what its value is. Be sure to print it out every time its value is changed.
Does the code use the value of counter only? It looks like it adds to it (+1)
Remember that indexes are 0 based. The max allowed value is the length-1
The max index for 12 chars is 11
A char literal is inside 's not "s
Look at the String class API doc. It has methods for finding the index values (location of) for short strings in a longer String. You could use that repeatedly to find the third comma.
Or you...