开发者

How to convert hexadecimal string to decimal?

I would appreciate it if you could tell me how I can convert hexadecimal letters within an NSString, e.g. @"50A6C2", to decimals using Objective-C. Thanks in advance.开发者_运维技巧


The easiest way is to use an NSScanner, specifically the methods scanHexInt: or scanHexLongLong:. Another possibility is to get the C string from the NSString and use C-style functions such as strtol (with base 16).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜