How to parse a search string..
How to parse a search string..
- Subject: How to parse a search string..
- From: David Delmonte <email@hidden>
- Date: Sun, 12 Feb 2012 17:02:14 -0500
I have a search box, and need to parse out some special characters (' and \). The search bar text is sbar.text.. How do I interrupt the string before it is sent and remove (or warn) of these characters... ? Many thanks..
I've tried this:
if ([sbar.text isEqualToString:(@"'")] || [sbar.text isEqualToString:(@"\\")]) {
NSLog(@"Found You");
sbar.text = nil;
(This works when the characters are first in the string..)
and this:
NSString *protectedString1 = sbar.text;
NSString *protectedString2 = [protectedString1 stringByReplacingOccurrencesOfString:@"'" withString:@" "];
sbar.text = protectedString2;
But this loops :)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden