#import <Foundation/Foundation.h>

 

int main(int argc, const char * argv[]) {

    @autoreleasepool {

        NSString* str = @"abc123.xyz789";

        NSInteger len = [str length];

        NSMutableString* reverse = [NSMutableString string];

        for(NSInteger i=len-1;i>=0;i--)

        {

            unichar c = [str characterAtIndex:i];

            NSString* temp = [NSString stringWithCharacters:&c length:1];

            [reverse appendString:temp];

        }

        NSLog(@"%@",reverse);

    }

    return 0;

}

 

posted on 2016-01-09 15:16  暂停  阅读(1243)  评论(0编辑  收藏  举报