字符串倒转的方法
- (NSString*)stringByReversed
{
NSMutableString*s = [NSMutableString string];
for(NSUInteger i=self.length; i>0; i--) {
[s appendString:[self substringWithRange:NSMakeRange(i-1,1)]];
}
returns;
}
- (NSString*)stringByReversed
{
NSMutableString*s = [NSMutableString string];
for(NSUInteger i=self.length; i>0; i--) {
[s appendString:[self substringWithRange:NSMakeRange(i-1,1)]];
}
returns;
}
本文标题:菜鸟教程——字符串倒转
本文链接:https://www.haomeiwen.com/subject/jlxskxtx.html
网友评论