List<long> to comma delimited string in C# -
this comes up. have list , want go comma delimited string of elements in list can use in sql.
what elegant way in c#? iterating on of them fine, except either first or last element has special-cased since don't want leading or trailing commas.
got one-liner?
string.join friend...
var list = new list<long> {1, 2, 3, 4}; var commaseparated = string.join(",", list);
Comments
Post a Comment