private string hexStrToStr(string str)
{
//去除字符串中的空格
string[] strT = str.Split(' ');
string strA = "";
foreach (string strB in strT)
{
strA += strB;
}
char[] chars = strA.ToCharArray();
string returnstr = "";
string[] str1 = new string[chars.Length / 2];
for (int i = 0; i < chars.Length / 2; i++)
{
string str111 = chars[2 * i].ToString() + chars[2 * i + 1].ToString();
uint num = uint.Parse(str111, System.Globalization.NumberStyles.AllowHexSpecifier);
char charr = (char)num;
returnstr = returnstr + charr;
}
return returnstr;
}
标签:string,C#,chars,Hex,char,Str,returnstr,strA
From: https://www.cnblogs.com/LCLBook/p/16592479.html