如何将nsstring转换为Binary以及将该Binary转换为Hexadecimal
问题描述:
我在字符串中有多个值 这是我的字符串示例
I am having multiple values in the string Here is the example of my string
str1 = @"20AB"
str2 = @"298C30:2FC0A0:2FC09C:FFFFFFFF:2FDFCD34:00"
str3 = @"4ffd565372df51089f2c824526f4f95a13daa867"
str4 = hexa(binary(str1 + str2 +str3))
即我需要将字符串转换为二进制,然后转换为十六进制的十进制,然后将所有3个字符串合并为一个字符串.
i.e. I need to convert the strings to Binary and then to Hexa decimal and then concat all 3 strings in a single string.
请帮助我.
预先感谢
答
您可以使用NSScanner转换为HEx和Bytes以读取二进制数据...
you can use NSScanner for converting to HEx and Bytes to read the binary data...