//過濾空格
NSString * urlStr = @" A as dd dmm ";
NSLog(@"urlStr = %@",urlStr);
//過濾字符串前後的空格
urlStr = [urlStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSLog(@"urlStr = %@",urlStr);
//過濾中間空格
urlStr = [urlStr stringByReplacingOccurrencesOfString:@" " withString:@""];
NSLog(@"urlStr = %@",urlStr);