Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(NSString *) reverseString
- {
- NSMutableString *reversedStr;
- int len = [self length];
- // Auto released string
- reversedStr = [NSMutableString stringWithCapacity:len];
- // Probably woefully inefficient...
- while (len > 0)
- [reversedStr appendString:
- [NSString stringWithFormat:@"%C", [self characterAtIndex:--len]]];
- return reversedStr;
- }
Add Comment
Please, Sign In to add comment