NSString * str = @"1234";
NSMutableString * reverseString = [NSMutableString string];
for(int i = 0 ; i < str.length; i ++){
//倒序读取字符并且存到可变数组数组中
unichar c = [str characterAtIndex:str.length- i -1];
[reverseString appendFormat:@"%c",c];
}
str = reverseString;
NSLog(@"%@",str); |