iOS ASCII NSString转换

2017-07-07  本文已影响2626人  kobehjk
// NSString to ASCII
NSString *string = @"A";
int asciiCode = [string characterAtIndex:0]; //65

//ASCII to NSString
int asciiCode = 65;
NSString *string =[NSString stringWithFormat:@"%c",asciiCode]; //A
上一篇下一篇

猜你喜欢

热点阅读