Guest User

Untitled

a guest
Jul 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. UnicodeEncoding encoding = new UnicodeEncoding();
  2. byte[] bytes = encoding.GetBytes(AnyString);
  3.  
  4. var str = "Hello";
  5. var bytes = [];
  6.  
  7. for (var i = 0; i < str.length; ++i)
  8. {
  9. bytes.push(str.charCodeAt(i));
  10. }
  11.  
  12. alert(bytes); // 72,0,101,0,108,0,108,0,111,0
Add Comment
Please, Sign In to add comment