iOS - 去除字符串里面所有空格

2020-05-12  本文已影响0人  biubiuboom
///去除空格
- (NSString *)removeSpaceAndNewline:(NSString *)str{
   
    NSString *temp = [str stringByReplacingOccurrencesOfString:@" " withString:@""];
    temp = [temp stringByReplacingOccurrencesOfString:@"\r" withString:@""];
    temp = [temp stringByReplacingOccurrencesOfString:@"\n" withString:@""];
    return temp;
}
上一篇下一篇

猜你喜欢

热点阅读