• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: searching for strings containing "
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: searching for strings containing "


  • Subject: Re: searching for strings containing "
  • From: Graham Cox <email@hidden>
  • Date: Tue, 27 Sep 2011 10:33:57 +1000

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 (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

_______________________________________________

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

References: 
 >searching for strings containing " (From: Koen van der Drift <email@hidden>)

  • Prev by Date: searching for strings containing "
  • Next by Date: Re: searching for strings containing "
  • Previous by thread: searching for strings containing "
  • Next by thread: Re: searching for strings containing "
  • Index(es):
    • Date
    • Thread