C# Hexadecimal to char

后端 未结 4 1233
Happy的楠姐
Happy的楠姐 2020-12-06 17:33

I have a hexidecimal string with a length of 4, such as \"003a\".

What is the best way to convert this into a char? First convert to bytes and then to char?

4条回答
  •  不思量自难忘°
    2020-12-06 17:43

    You can use the following code:

    label1.Text = System.Convert.ToChar(System.Convert.ToUInt32("0x00AC", 16)).ToString();
    

提交回复
热议问题