• 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: String comparison newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String comparison newbie question


  • Subject: Re: String comparison newbie question
  • From: Andrew Farmer <email@hidden>
  • Date: Sat, 18 Nov 2006 01:40:40 -0800

On 18 Nov 06, at 01:29, Carl Johan Foss wrote:
I am trying to search a string to find a word in a string. I am using the comparison method but for some reason it does not work.

-[NSString compare:options:] is for testing two strings to see how they should be sorted. It returns NSOrderedSame, NSOrderedAscending, or NSOrderedDescending, depending on how the two strings should be ordered.


For case-insensitive searching, use -[NSString rangeOfString:options:]. NSScanner is overkill for this task.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >String comparison newbie question (From: Carl Johan Foss <email@hidden>)

  • Prev by Date: String comparison newbie question
  • Next by Date: OFRegularExpression Quantifier
  • Previous by thread: String comparison newbie question
  • Next by thread: OFRegularExpression Quantifier
  • Index(es):
    • Date
    • Thread