博客
关于我
c# json key转大小写
阅读量:407 次
发布时间:2019-03-06

本文共 290 字,大约阅读时间需要 1 分钟。

有需求需要将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());                }

 

转载地址:http://wnvkz.baihongyu.com/

你可能感兴趣的文章
MySQL之SQL语句优化步骤
查看>>
MYSQL之union和order by分析([Err] 1221 - Incorrect usage of UNION and ORDER BY)
查看>>
Mysql之主从复制
查看>>