Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem_5_UnicodeCharacters
- {
- class UnicodeCharacters
- {
- static void Main()
- {
- string input = Console.ReadLine();
- Console.WriteLine(GetHexFromChar(input));
- }
- static string GetHexFromChar(string text)
- {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < text.Length; i++)
- {
- sb.Append(String.Format(@"\{0:x4}", (ushort)text[i]));
- }
- return sb.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement