fork download
  1. using System;
  2. using System.Text;
  3. using System.IO;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. Stream inputStream = Console.OpenStandardInput();
  10. byte[] bytes = new byte[100000];
  11. int outputLength = inputStream.Read(bytes, 0, 100000);
  12. char[] chars = Encoding.UTF7.GetChars(bytes, 0, outputLength);
  13. var all = new string(chars);
  14. var opening = (all.Length - all.Replace("{", "").Length);
  15. var closing = (all.Length - all.Replace("}", "").Length);
  16. Console.WriteLine("Opening bracket count: {0}. Closing bracket count: {1}, other thing (\") count: {2}", opening, closing, (all.Length - all.Replace("\"", "").Length));
  17. }
  18. }
Success #stdin #stdout 0.05s 23984KB
stdin
/tellraw @a [{"text":"I am a "},{"text": "DOOFUS", "color":"red"},{"text":". "},{"text":"Yes","color":"red","clickEvent":{"action":"run_command","value":"/tellraw @a [{\"text\":\"You are \"},{\"text\":\"OFFICIALLY \",\"color\":\"red\"},{\"text\":\"a \"},{\"text\":\"DOOFUS\",\"color\":\"red\"},{\"text\":\"\nGo to the bottom-left of the map name.\"}]"}},{"text":"No","color":"green","clickEvent":{"action":"run_command", "value":"/tellraw @a {\"text\":\"\n\n\n\n\n\n\n\n\n\n \"}"}}]
stdout
Opening bracket count: 13. Closing bracket count: 13, other thing (") count: 84