Sunday, 16 September 2018

Comma Delimited(Saperated) string of arraylist using LINQ Query

In this post, I will explain how to get Comma Delimited (Separated) string of ArrayList using LINQ Query.

In below example, I want a single string containing all elements from ArrayList with separation character comma(","). 

List<string> str = new List<string>(new string[]{"Harry", "Sandy", "John" , "Mahesh"});

Label1.Text = string.Join(", ", str);

Comma Delimited
ArrayList

Comma Saperated String
Result Comma Separated String

0 comments:

Post a Comment

Please do not enter any spam link in the message box.