Last active
June 20, 2018 09:15
-
-
Save dinowang/e1afbf995eb530f4ab6bd45d2af0a744 to your computer and use it in GitHub Desktop.
C# convert string to hexadecimal string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "1234中文"; | |
var hex = string.Join("", Encoding.GetEncoding("BIG5").GetBytes(str).Select(x => $"{x:X2}")); | |
// hex = "31323334A4A4A4E5" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment