I am trying to remove all spaces from json formatted string and as a result i need all json in single line string.
Like below
[{"type":"text","label":"FirstName","name":"firstname","subtype":"text","className":"redform-control"},{"type":"select","label":"Profession","className":"form-control","name":"profession","values":[{"label":"StreetSweeper","value":"StreetSweeper"},{"label":"BrainSurgeon","value":"BrainSurgeon"}]},{"type":"textarea","label":"ShortBio:","className":"form-control","name":"short-bio","subtype":"textarea","rows":"4"}]
I have tried but it removes all spaces inside or like
"label":"First Name"
converts into
"label":"FirstName"
I need it in a single line string but inside inverted comma data would not be affected.
What I have tried:
var content = Regex.Replace(jsonContent, @"\s+", string.Empty);