码迷,mamicode.com
首页 > Windows程序 > 详细

c# json key转大小写

时间:2017-06-02 11:33:32      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:log   key   code   reg   round   使用   需要   c#   regex   

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

 

c# json key转大小写

标签:log   key   code   reg   round   使用   需要   c#   regex   

原文地址:http://www.cnblogs.com/bfyx/p/6931935.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!