The following code snippet shows how to convert from a CSV string to a List using the string class Split method.
The following code snippet shows how to convert from a list to a CSV string using the string class Join method.
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);
Sign up here with your email
ConversionConversion EmoticonEmoticon