C# hex to ascii

前端 未结 4 535
有刺的猬
有刺的猬 2020-12-03 14:05

I\'m trying to convert a String of hex to ASCII, using this:

public void ConvertHex(String hexString)
{
    StringBuilder sb = new StringBuilder();

    for          


        
4条回答
  •  庸人自扰
    2020-12-03 14:42

    String hs = hexString.Substring(i, i + 2);
    System.Convert.ToChar(System.Convert.ToUInt32(hexString.Substring(0, 2), 16)).ToString();
    

    Do you notice you're never using hs ??

    And that you're converting the first 2 chars over and over?

提交回复
热议问题