(IOS)移除字符串中的空格和换行

+ (NSString*)removeSpaceAndNewline:(NSString*)str {

    NSString *temp = [str stringByReplacingOccurrencesOfString:@" " withString:@""];

    temp = [tempstringByReplacingOccurrencesOfString:@"\r" withString:@""];

    temp = [tempstringByReplacingOccurrencesOfString:@"\n" withString:@""];

    returntemp;

}

你可能感兴趣的:((IOS)移除字符串中的空格和换行)