码迷,mamicode.com
首页 > 其他好文 > 详细

字符串反转,

时间:2014-07-06 23:22:46      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:cti   for   io   new   table   app   

-(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);

 

}

字符串反转,,布布扣,bubuko.com

字符串反转,

标签:cti   for   io   new   table   app   

原文地址:http://www.cnblogs.com/guligei/p/3822552.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!