NSString * str = @"abcdefg";
NSMutableString * string = [[NSMutableString alloc]initWithCapacity:str.length];
int j = (int)str.length;
for (int i = j - 1; i >= 0; i--) {
[string appendFormat:@"%c", [str characterAtIndex:i]];
}
NSLog(@"string____%@",string);
转载于:https://www.cnblogs.com/tongyuling/p/7195106.html
最后
以上就是糊涂西牛最近收集整理的关于IOS中怎样把一个字符串倒序输出的全部内容,更多相关IOS中怎样把一个字符串倒序输出内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复