It is a pattern that occurs quite often in one part of our Framework. Given an Array of Strings, we have to concat all of them, seperated by Semicolons.
I´d like to know
You can use string.Join():
string.Join()
String[] values = new String[] {"a","b","c","d"}; var concat = string.Join(", ", values);
This will result in something looking like this:
a, b, c, d
try:
var result = string.Join(",", values.Where(s => !string.IsNullOrEmpty(s)));