NSArray *array = [str componentsSeparatedByString:@"\r\n"]; NSString *strNew = [array componentsJoinedByString:@""];