• 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
Searching for "whole word" in NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Searching for "whole word" in NSString


  • Subject: Searching for "whole word" in NSString
  • From: John Stiles <email@hidden>
  • Date: Tue, 29 Jan 2008 10:12:21 -0800

I'm trying to find a substring in an NSString. But I want to find whole words (e.g. like in the Find panel when you choose "Full word" from the popup, rather than "Contains" or "Starts With").

Unless I'm missing something, it looks like NSString's -rangeOfString:options:range:locale: doesn't have an option for finding whole words.

How does the Find panel do it, then? Am I going to have to "roll my own" code for string searching? That sounds error-prone to me; I'd much rather have the OS do it.
_______________________________________________


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


  • Follow-Ups:
    • Re: Searching for "whole word" in NSString
      • From: mmalc crawford <email@hidden>
    • Re: Searching for "whole word" in NSString
      • From: Citizen <email@hidden>
  • Prev by Date: Re: Close a menu programmatically
  • Next by Date: KVC/KVO not working for a variable in custom view
  • Previous by thread: Re: [Leopard, GC] Custom view in NSMenuItem crashes
  • Next by thread: Re: Searching for "whole word" in NSString
  • Index(es):
    • Date
    • Thread