Is there a direct equivalent in Java for Python's str.join?

Viewed 13636

Possible Duplicates:
What’s the best way to build a string of delimited items in Java?
Java: convert List<String> to a join()d string

In Java, given a collection, getting the iterator and doing a separate case for the first (or last) element and the rest to get a comma separated string seems quite dull, is there something like str.join in Python?

Extra clarification for avoiding it being closed as duplicate: I'd rather not use external libraries like Apache Commons.

Thanks!

update a few years after...

Java 8 came to the rescue

5 Answers
Related