I'm converting some code to use some of the new features in
Java 1.5. The old code looks something like this:
Is there a similar way to do this in a foreach loop? I can't find anything to check whether the current item in the foreach loop is the last one.
The only way I see to do it is either with the Iterator above, or with a foreach and getting rid of the comma at the end of the
string after you exit the loop.
I know this isn't an earth shattering question, but curious if I'm missing another way to do this using foreach.
Thanks,
Joe