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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -