-(NSString *)encodeString:(NSString *)string
{
NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR("% '\"?=&+<>;:-"), kCFStringEncodingUTF8); return [result autorelease];
}
or
We Can insert %20 in place on Space in String by below statement:
str =[str stringByAddingPercentEscapesUsingEncoding:NSStringEncodingConversionExternalRepresentation];
{
NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR("% '\"?=&+<>;:-"), kCFStringEncodingUTF8); return [result autorelease];
}
or
We Can insert %20 in place on Space in String by below statement:
str =[str stringByAddingPercentEscapesUsingEncoding:NSStringEncodingConversionExternalRepresentation];
No comments:
Post a Comment