NSString *test = @"ABCDEFGAUJHGB\nAGR\nIUNJAOJNT"; NSLog(@"%@ ------- %d",test,[[test componentsSeparatedByString:@"\n"] count]-1);