//解决url中文问题 编码
- (NSString *)encodeURLWithString:(NSString *)unescapedString{
NSString *outputStr = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,(CFStringRef)unescapedString,NULL,(CFStringRef)@"!*'();:@&=+$,/?%#[]",kCFStringEncodingUTF8);
return outputStr;
}
//解码
- (NSString *)decodeURLWithString:(NSString *)str{
NSString *string3 = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return string3;
}
//去掉输入框两端的空格
- (NSString *)deleteWhitespaceWithStr:(NSString *)str{
return [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
//去掉输入框中间空格
- (NSString *)removeSpace:(NSString *)str{
return [str stringByReplacingOccurrencesOfString:@" " withString:@""];
}