-(IBAction)abc:(id)sender
{
NSString *a = @"abcdef";
NSMutableString *newA = [[NSMutableString alloc]init];
int length = a.length;
for (int i = 0; i<length; i++) {
char m = [a characterAtIndex:length - i - 1];
NSString *sM = [NSString stringWithFormat:@"%c",m];
[newA appendString:sM];
// [a stringByReplacingCharactersInRange:NSMakeRange(i, 1) withString:[NSString stringWithFormat:@"%c",m]];
}
TTLog(@"%@",newA);
}
原文:http://www.cnblogs.com/guligei/p/3822552.html