有需求需要将json的字段转换为小写,使用正则表达式实现,代码如下

正则表达式为   \"[a-zA-Z0-9]+\"\s*:

               MatchCollection ms = Regex.Matches(strJsonData, "\\\"[a-zA-Z0-9]+\\\"\\s*:");
                foreach ( Match item in ms)
                {
                    strJsonData.Replace(item.Value, item.Value.ToLower());
                }  

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2022-02-05
猜你喜欢
  • 2021-11-30
  • 2022-12-23
  • 2022-02-26
  • 2021-10-24
  • 2022-12-23
  • 2021-12-17
  • 2021-12-04
相关资源
相似解决方案