1.  首页
  2.  博客
  3. trim 一个 NSString

trim 一个 NSString


trim NSString

NSString * string = @"\n \t\t hello string  \t\n  \n\n";
NSString * trimed = [string stringByTrimmingCharactersInSet:
             [NSCharacterSet whitespaceAndNewlineCharacterSet]]
NSLog(@"%@", trimed);

评论 0