Convert integer to string and use each character
How is an integer converted to a string开发者_开发百科 in objective c and how is each character of the string reached?
The equivalent to the java charAt() method.
NSString *myString = [NSString stringWithFormat:@"%i", 36];
[myString characterAtIndex:0]; //"3"
[myString characterAtIndex:1]; //"6"
Update: Note that characterAtIndex
returns a unichar not a c char. Thanks @Chuck.
精彩评论