+ (NSString *) escapeString:(NSString *)string {
NSRange range = NSMakeRange(0, [string length]);
return [string stringByReplacingOccurrencesOfString:@"'" withString:@"''" options:NSCaseInsensitiveSearch range:range];
}
Ondrej Rafaj on 2009.11.05 12:38:40
This function will escape the NSString for SQLite3 database. You can use this function to escape or change any other character.
+ (NSString *) escapeString:(NSString *)string {
NSRange range = NSMakeRange(0, [string length]);
return [string stringByReplacingOccurrencesOfString:@"'" withString:@"''" options:NSCaseInsensitiveSearch range:range];
}
Ondrej Rafaj
Independent iPhone developer @ ondrej-rafaj.co.ukI am available to give you a free quote or start working on your project ... just give me a call or drop a line. Please find all my details on my portfolio site ondrej-rafaj.co.uk
We had to disable comments till the problem with spam will be solved, sorry for any inconvenience caused.