fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. // Copiado diretamente do JSON Orignal
  9. var json = "{\"novosPedidos\":[],\"pedidos\":[{\"Apagar\":\" 633.56\"}]}";
  10. var newJson = json.Replace(":\"\u00A0", ":\"");
  11. var newJsonWithRegex = Regex.Replace(json, @"[:][""]\s+", ":\"");
  12. Console.WriteLine(newJson);
  13. Console.WriteLine(newJsonWithRegex);
  14.  
  15. // Antigo
  16. json = "{\"novosPedidos\":[],\"pedidos\":[{\"Apagar\":\" 633.56\"}]}";
  17. newJson = json.Replace(":\" ", ":\"");
  18. Console.WriteLine(newJson);
  19. }
  20. }
Success #stdin #stdout 0.06s 21304KB
stdin
Standard input is empty
stdout
{"novosPedidos":[],"pedidos":[{"Apagar":"633.56"}]}
{"novosPedidos":[],"pedidos":[{"Apagar":"633.56"}]}
{"novosPedidos":[],"pedidos":[{"Apagar":" 633.56"}]}