How would I do this?
To bring it into some better context, I'm having a value from an XML attribute and I want each individual value to be added to an array of strings and each of those values is separated by commas
How would I do this?
To bring it into some better context, I'm having a value from an XML attribute and I want each individual value to be added to an array of strings and each of those values is separated by commas
Is string.Split
what you're after? It's not entirely obvious from your question.
string text = "a,b,c";
string[] bits = text.Split(',');
foreach (string bit in bits)
{
Console.WriteLine(bit);
}
how are these values stored in the xml? If you know the structure of the xml you can easily extract the info..i din quite get the next part. you want to make a CSV but u also want to store it in an array.but wont the array itself seperate the values?
string input = Console.ReadLine();
char splitter = ',' ;
string[] output = input.Split(splitter);
foreach (string t in output)
{
Console.WriteLine(t);
}