fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string input = "\"THIS IS \"inner1\" THE MAIN \"inner2\" SENTENCE\"";
  8. // First remove the out quotes, we will manually change them at the end.
  9. string result = input.Substring(1, input.Length - 2);
  10. // Replace quotes that follow space with « and replace quotes that precede space with »
  11. result = result.Replace(" \"", " «").Replace("\" ", "» ");
  12. // Add the outer chevrons around the result.
  13. result = string.Format("«{0}»", result);
  14.  
  15. Console.WriteLine(result);
  16. }
  17. }
Success #stdin #stdout 0.02s 14936KB
stdin
Standard input is empty
stdout
«THIS IS «inner1» THE MAIN «inner2» SENTENCE»