Last active
August 29, 2015 14:02
-
-
Save mattcanty/985b49d90d9efb0b24bb to your computer and use it in GitHub Desktop.
Minify Json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string MinifyJson(string unminifiedJson) | |
{ | |
return Regex.Replace(unminifiedJson, "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All credit to Mike Samuel over at Stack Overflow - http://stackoverflow.com/a/8913186/966609