Advertisement
Guest User

05. Unicode Characters

a guest
May 13th, 2015
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. class UnicodeCharacters
  8. {
  9.     static void Main()
  10.     {
  11.         string input = Console.ReadLine();
  12.  
  13.         StringBuilder sb = new StringBuilder();
  14.         foreach (var character in input)
  15.         {
  16.             sb.Append("\\u");
  17.             sb.Append(String.Format("{0:x4}", (int)character)); ;
  18.         }
  19.         Console.WriteLine(sb.ToString());
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement