我想知道是否有人在Objective-C中为iPhone开发提供以下php功能:
非常感谢!
all*_*eus 117
这是你如何使用ASCII值和NSString.请注意,由于NSString使用unichars,非ASCII字符串可能会出现意外结果.
// 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
Run Code Online (Sandbox Code Playgroud)
luv*_*ere 12
//char to int ASCII-code
char c = 'a';
int ascii_code = (int)c;
//int to char
int i = 65; // A
c = (char)i;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
48295 次 |
| 最近记录: |