Hi, (sorry for my english!)
I have a file like this:
"string1","string2","string3","string4"....
I want the string between the " without the " and the ,
In php, my co-worker used this:
preg_match_all(|"([^"]*)",?|i, $content, $matches);
$content = the file
We upgrade in C#
With c# I use something like this:
MatchCollection Matches = Regex.Matches(fiche, "\"([^\"]*)\",?", RegexOptions.IgnoreCase);
I put the result in an array:
for (int i = 0; i < Matches.Count; i++)
{
array.Add(Matches[0].Groups.ToString();
}
I have this result
0: "string1",
1: string1
2: (empty)
3: (empty)
....
But I have the right count of string.
I really dont understand whats wrong.
Thank you
I have a file like this:
"string1","string2","string3","string4"....
I want the string between the " without the " and the ,
In php, my co-worker used this:
preg_match_all(|"([^"]*)",?|i, $content, $matches);
$content = the file
We upgrade in C#
With c# I use something like this:
MatchCollection Matches = Regex.Matches(fiche, "\"([^\"]*)\",?", RegexOptions.IgnoreCase);
I put the result in an array:
for (int i = 0; i < Matches.Count; i++)
{
array.Add(Matches[0].Groups.ToString();
}
I have this result
0: "string1",
1: string1
2: (empty)
3: (empty)
....
But I have the right count of string.
I really dont understand whats wrong.
Thank you