Escape the " using a backslash, i.e. \"

e.g.

NSString* string = @"this is\"quoted\"";

--Graham





On 27/09/2011, at 10:26 AM, Koen van der Drift wrote:

> How do I use isEqualToString with strings that contain a " ?
> 
> The string I try to find is for instance:  name= "foo" Type="bar"
> 
> So:
> 
>        if ([myString isEqualToString: @"name= "foo" Type="bar"")
> 
> Gives an error because there are too many " symbols.  I looked into replacing 
> the " with ' by using stringByReplacingOccurrencesOfString:withString:  , but 
> that gives the same problem.
> 
> 
> Thanks,
> 
> - Koen.
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com
> 
> This email sent to graham....@bigpond.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to