代码如下:
+(NSString *)dealWithSpecialCharacter:(NSString *)string
{
return CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)string,
NULL,
CFSTR(":/?#[]@!$&’()*+,;="),
kCFStringEncodingUTF8));
}
写一个分类,方便调用