Skip to content

Instantly share code, notes, and snippets.

@harichinthalapale
Created August 2, 2012 12:43
Show Gist options
  • Select an option

  • Save harichinthalapale/3236777 to your computer and use it in GitHub Desktop.

Select an option

Save harichinthalapale/3236777 to your computer and use it in GitHub Desktop.
sanitized values for html data
+ (NSString *) sanitizeValue: (NSString *)value
{
NSString *sanitizedValue = [value stringByReplacingOccurrencesOfString:@"&" withString:@"&"];
sanitizedValue = [sanitizedValue stringByReplacingOccurrencesOfString:@""" withString:@"\""];
sanitizedValue = [sanitizedValue stringByReplacingOccurrencesOfString:@"’" withString:@"'"];
sanitizedValue = [sanitizedValue stringByReplacingOccurrencesOfString:@"“" withString:@"'"];
return sanitizedValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment