方式是将字符串分隔,先,分隔,再用:分隔。最后再 .ToDictionary 转换为字典。然后就大家都会获取了


            string str = "{\"fcode\":\"10\",\"fno\":\"009999\",\"fmemo\":\"009999-4\"}";

            Dictionary<string, object> dd = str.Trim(new char[] { '{', '}' }).Split(',').ToDictionary(s => s.Split(':')[0].Trim('"'), s => (object)s.Split(':')[1].Trim('"'));

            Console.WriteLine(dd["fcode"]); 

相关文章:

  • 2021-07-29
  • 2022-12-23
  • 2021-11-26
  • 2021-05-21
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2021-12-06
  • 2021-08-11
相关资源
相似解决方案