const string ColoursCsv = "red,blue,green,yellow";
                         
List<string> coloursList = ColoursCsv.Split(',').ToList();
List<string> coloursList = ColoursCsv.Split(',').ToList();
The following code snippet shows how to convert from a list to a CSV string using the string class Join method.
 List<string> coloursList = new List<string> { 
"red",
"blue",
"green",
"yellow"
};
 
string coloursCsv = string.Join(",", coloursList);
"red",
"blue",
"green",
"yellow"
};
string coloursCsv = string.Join(",", coloursList);
 
 
No comments:
Post a Comment