I often find myself having to concatenate the
string values of objects in a collection into a comma-separated string.
I use a StringBuffer and append() in an iteration over the collection, but I have a nagging feeling that there's a built-in operation for this that I'm just not finding.
Is there a way to concatenate a collection of objects' string values into a string, optionally separated by another character(s) a la Perl's join( separator, array ) ?
I'd expect it to be in the Collections framework, but, apart from AbstractCollection's toString() method - which is close - I can't seem to locate it.