fork(10) download
  1. using System;
  2. using System.Text;
  3.  
  4. class Program
  5. {
  6. static void Main()
  7. {
  8. var str = Encoding.ASCII.GetString(new byte[] {
  9. 0x54, 0x65, 0x73, 0x74, 0x20, 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65
  10. });
  11.  
  12. Console.WriteLine("Input: {0}", str);
  13.  
  14. var bytes = Encoding.Unicode.GetBytes(str + "\0");
  15.  
  16. Console.Write("Output:");
  17.  
  18. foreach (var b in bytes) {
  19. Console.Write(' ');
  20. Console.Write(b.ToString("X2"));
  21. }
  22.  
  23. Console.WriteLine();
  24. }
  25. }
Success #stdin #stdout 0.03s 33888KB
stdin
Standard input is empty
stdout
Input: Test message
Output: 54 00 65 00 73 00 74 00 20 00 6D 00 65 00 73 00 73 00 61 00 67 00 65 00 00 00