Objective-C如何把UTF-8字符串转换为十六进制数

来源:互联网 发布:全网vip电影源码 编辑:程序博客网 时间:2024/06/05 22:35

NSString *s1 = @"10";unsigned long l1 = strtoul([s1 cStringUsingEncoding:NSUTF8StringEncoding], NULL, 16);NSLog(@"%ld",l);

strtoul: string to unsigned long

0 0