Every once in a while, I need to build a character separated string while looping through a collection. Believe it or not, there is always that first or last separator character that gets in the way! :) Usually, I end up chopping off the extra character, which is another line of code. I could leave with that, but out of curiosity, does anyone have any cool "smooooth" way of doing this? (in C# and/or JavaScript)
Example:
{"Joe", "Jane", "Jim"}
After building comma separated string, we get:
"Joe, Jane, Jim, "
or ", Joe, Jane, Jim"
Looking for a cool way to build
"Joe, Jane, Jim"
without any string "chopping" after.