开发者

How can I convert Special Format String to Text?

How can I convert the string 00 00 EF 01 00 00 00 00 00 00 to text?

I googled and found a online tool which can convert binary to text only.开发者_如何学Go


This values are in HEX - This tool does hex as well, you can always transalte HEX to decimal and then take their ASCII value...


I created a tool few years ago that can convert/encode strings. Hope you'll find it useful.


I'm assuming here the text you've supplied is "as is", with spaces separating the hex digit pairs.

You can convert each hex value with, e.g.:

byte.Parse("EF", System.Globalization.NumberStyles.AllowHexSpecifier)

So you can convert the whole to a byte array:

var byteArray = "0A 0A 0A".Split(' ').Select(s => byte.Parse(s, System.Globalization.NumberStyles.AllowHexSpecifier)).ToArray();

However, you don't specify what character encoding your hex stream represents. Once you've got your byte array, you'll need to convert it as necessary.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜