We try to not simply provide solutions here, but focus on helping each person figure it out for themselves. Please don't post solutions - ask leading questions, make suggestions, point out errors in code the questioner provides... things like that.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
posted 9 years ago
You can also do it by putting the two Strings into StringBuilders, then deleting the comma at the beginning and appending them. You might need a toString() call before appending.