日期:2014-05-16  浏览次数:20967 次

C# 替换掉字符串双引号内的空值
  有一串字符串内容如下   
"A01":"1","A02":"2","A03":"","A04":"4","A05":"5,147.23","A06":"","A07":"7"

  请问
  1、怎样才能将字符串双引号之内的空值替换为-,即将""替换为"-"
  2、怎样才能替换掉双引号之内的逗号而不替换掉双引号之外的逗号
------解决方案--------------------
        "\"A01\":\"1\",\"A02\":\"2\",\"A03\":\"\",\"A04\":\"4\",\"A05\":\"5,147.23\",\"A06\":\"\",\"A07\":\"7\"".Replace("\"\"", "\"-\"");
------解决方案--------------------
2.

str=Regex.Replace(str,"(?<!\"[^\"]+),","");