NSString *ook = @"\n \t\t hello there \t\n \n\n"; NSString *trimmed = [ook stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSLog(@"trimmed: '%@'", trimmed);produces2009-12-24 18:24:42.431 trim[6799:903] trimmed: 'hello there'