Hello !
Let there is a string :
string name = "a1,b1,\"c,1\",d1";
Now I use the following code to replace the comma between " " by a Ý .
Now if I want to do the same using regular expression, what should I do ?int firstIndx = 0, scndIndx = 0;
string cutstr ;
firstIndx = name.IndexOf("\"");
if (firstIndx >= 0)
{
scndIndx = name.IndexOf("\"", firstIndx + 1);
cutstr = name.Substring(firstIndx, scndIndx - firstIndx + 1);
name = name.Remove(firstIndx, scndIndx - firstIndx + 1);
//cutstr = cutstr.Replace("\"", "¢");
cutstr = cutstr.Replace(",", "Ý");
name = name.Insert(firstIndx, cutstr);
}
Thank you.




Bookmarks