Sometime developer required convert List to comma separated string.
So here we just quick look of string.Join code magic and get our expected result.
List number = new List();
number.Add(1);
number.Add(4);
number.Add(50);
number.Add(78);
string strNumber = string.Join(",", number.ToArray());
Response.Write(strNumber);
Output: 1,4,50,78
Hope you enjoy it!!
So here we just quick look of string.Join code magic and get our expected result.
List
number.Add(1);
number.Add(4);
number.Add(50);
number.Add(78);
string strNumber = string.Join(",", number.ToArray());
Response.Write(strNumber);
Output: 1,4,50,78
Hope you enjoy it!!
Good and simple example ... Thanks
ReplyDelete