- (NSString *)noWhiteSpaceString {
NSString *newString = self;
// newString = [newString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; //去除掉首尾的空白字符和换行字符
newString = [newString stringByReplacingOccurrencesOfString:@"\r" withString:@""];
newString = [newString stringByReplacingOccurrencesOfString:@"\n" withString:@""];
newString = [newString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; //去除掉首尾的空白字符和换行字符使用
newString = [newString stringByReplacingOccurrencesOfString:@" " withString:@""];
// 可以去掉空格,注意此时生成的strUrl是autorelease属性的,所以不必对strUrl进行release操作!
// newString = [newString stringByReplacingOccurrencesOfString:@"\n" withString:@""];
return newString;
}