Objective-C 2.0学习笔记之NSMutableString
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; //+ (id) stringWithFormat: (NSString *) format,...; NSMutableString *friends=[NSMutableString stringWithCapacity:50]; [friends appendFormat:@"I love duoduoluo,and you?"]; NSRange range=[friends rangeOfString:@"you"]; range.length++; [friends deleteCharactersInRange:range]; NSLog(@"%@",friends); [pool drain]; return 0; } |
输出:[Session started at 2010-08-18 17:25:58 +0800.]
2010-08-18 17:25:58.802 nsstring[148:903] I love duoduoluo,and
The Debugger has exited with status 0
近期评论