Skip to content

One line of regular expression to delete the blank in JSON

License

Notifications You must be signed in to change notification settings

wanggangzero/Reg_JSMin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Reg_JSMin

One line of regular expression to delete the blank in JSON.

一行正则表达式删除JSON字符串中的所有空白字符.

C#

   public static string JsMin(this string str)  //  C# Extension Method
    {
        return str.RegReplace("(?<=\"|:|,|\\{|\\}|\\[|\\])\\s+(?=\"|:|,|\\{|\\}|\\[|\\]|null|\\d)", "");
    }

LICENSE

unlicense

About

One line of regular expression to delete the blank in JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published