Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
finding substring
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

finding substring



Hello,

I'm assuming that when a user is trying to search for "São Paulo" in my program that they might use "sa" as a search string.

1. Is this a good assumption?
2. What is the best way to find a sub-string and ignore diacritical marks?

I'm currently using this code which does not ignore diacritical marks:
 NSString *searchStr = @"sa";
 NSString *placeName = @"São Paulo";
 NSRange nameRange = [placeName rangeOfString:searchStr
			options:NSCaseInsensitiveSearch];
 if (nameRange.location != NSNotFound)
	NSLog(@"found string!");

Thanks,
Chuck
_______________________________________________
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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.