日期:2014-05-17  浏览次数:20451 次

替换掉范围内指定字符串(急)
string temp="as,df;fdsa,fas;223,fd;adf,fdas;\"fdsa,dfas,fdas,fdas\",fdas;fdas,fdas;";
去带哦\"中间的,\" 逗号为固定的 \" 可以做为参数传进来

------解决方案--------------------
C# code
 string para = "\"";
                string temp = "as,df;fdsa,fas;223,fd;adf,fdas;\"fdsa,dfas,fdas,fdas\",fdas;fdas,fdas;";
                string temp_pattern = @"(?<="+para+@"[\s\S]*?),(?=[\s\S]*?"+para+")";
                temp = Regex.Replace(temp, temp_pattern, "");//as,df;fdsa,fas;223,fd;adf,fdas;\"fdsadfasfdasfdas\",fdas;fdas,fdas;

------解决方案--------------------
1楼正解