Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string HexStringToAscii(string HexString, bool clean)
- {
- string R = "";
- if (HexString.Length % 2 > 0) HexString = "0" + HexString;
- for (int i = 0; i < HexString.Length; i += 2)
- {
- R += Convert.ToChar(Convert.ToByte(HexString.Substring(i, 2), 16));
- }
- if (clean) return R.Replace("\0", "");
- return R;
- }
Advertisement
Add Comment
Please, Sign In to add comment