FROM : John Stiles
DATE : Tue Jan 29 19:12:21 2008
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.
DATE : Tue Jan 29 19:12:21 2008
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 mail archive

