税号{沪}   ==>    税号{苏}
这个怎么替换啊

解决方案 »

  1.   

    "税号{沪}".Replace("{沪}","{苏}")
      

  2.   

    string aaa="税号{沪}".Replace("{沪}","{苏}")aaa是替换好的
      

  3.   

    不需要定位的
    如果用的是REPLACE,系统会自动去查找你字符串中是否存在{沪}这个字的,如果存在,则替换
      

  4.   

    Text = System.Text.RegularExpressions.Regex.Replace(
        "税号{沪、京}", @"\{[^\}]*\}", "{苏}");
      

  5.   

    Text = System.Text.RegularExpressions.Regex.Replace(
        "*******{*******}", @"\{[^\}]*\}", "{@@@@}");