Label.Text在页面上显示的值是{"error":0,"x":"AAA","y":"CCC"}我想分别截取Label.Text中的X:后面的AAA和y:后面的BBB(当然AAA和CCC只是举个例子,真实的AAA和CCC是动态数据)我想得出:
Label2.Text=AAA;
Label7.Text=CCC;

解决方案 »

  1.   

    直接split('') 函数不就可以了么
      

  2.   

     string labtxt = @"{""error"":0,""x"":""AAA"",""y"":""CCC""}";
                Match mlab = Regex.Match(labtxt, @"""(x|y)"":""(?<value>[^""]*?)""");
                string XValue = mlab.Groups[2].Captures[0].Value;
                string YValue = mlab.NextMatch().Groups[2].Captures[0].Value;