c# - Add comma between values by using Linq -
my values come combobox:
2|722|742|762|77
i delete unnecessary characters follows:
foreach (var item in checklistbox) { string[] list = item.split( new string[] { "2|" }, stringsplitoptions.removeemptyentries); }
my list values result:
"72" "74" "76" "77"
my question is:
how can of above values in 1 row (next each other) separated comma this:
72,74,76,77
?
how about
var result = string.join(",", item.split(new string[] { "2|" }, stringsplitoptions.removeemptyentries));
Comments
Post a Comment