I am trying to split an array of strings where each of them have "," as the delimiter. I obtained the array of strings after an earlier split using regex for the pattern of new line. The input is from a text file and here is the pattern as in the text file.
Contents of my text file
"first", "second"
"third", "fourth", "fifth"
"Sixth", "seventh"
Second text file
"Color.auto", "(current == ff) && (current == 00)"
"Color.auto", "(current == ff) ? ((Current > 0) && (current < 10))"
The code which creates an array of strings split on new line character.
StreamReader sr = new stream reader(file.txt);
String data = sr.ReadToEnd();
String pattern = @"\r\n";
String[] result = regex.split(data, pattern);
foreach(string store in result)
{
String temp = store.split(",".ToCharArray());
}
The problem I am facing is that I am unable to split the strings on "," further using "split". I believe it is due to the array of strings which I am trying to split.
Storeinstead ofstore?regex, justSplitmethod of string would be OK.Splitfor the first step.