Advertisement
petromaxa

Untitled

Jan 31st, 2013
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _10.ConvertStringToCharString
  7. {
  8. class ConvertStringToCharString
  9. {
  10. static void Main()
  11. {
  12.  
  13. string str = "Hi!";
  14. string newString = null;
  15. for (int i = 0; i < str.Length; i++)
  16. {
  17. newString = String.Format("{0}{1}{2}",newString,"\\u",Convert.ToString(((int)str[i]),16).PadLeft(4,'0'));
  18. }
  19. Console.WriteLine(newString);
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement