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;
- namespace _10.ConvertStringToCharString
- {
- class ConvertStringToCharString
- {
- static void Main()
- {
- string str = "Hi!";
- string newString = null;
- for (int i = 0; i < str.Length; i++)
- {
- newString = String.Format("{0}{1}{2}",newString,"\\u",Convert.ToString(((int)str[i]),16).PadLeft(4,'0'));
- }
- Console.WriteLine(newString);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement