fork download
  1. using System;
  2. using System.Text;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var utf16 = Encoding.Unicode;
  10. var s = "Test message";
  11. var bytes = utf16.GetBytes(s);
  12. string output = string.Join(" ", bytes.Select(b => b.ToString("X2")).ToArray());
  13. Console.WriteLine(output);
  14. }
  15. }
Success #stdin #stdout 0.03s 34808KB
stdin
Standard input is empty
stdout
54 00 65 00 73 00 74 00 20 00 6D 00 65 00 73 00 73 00 61 00 67 00 65 00