NSCharacterSet and NSCaseInsensitiveSearch
NSCharacterSet and NSCaseInsensitiveSearch
- Subject: NSCharacterSet and NSCaseInsensitiveSearch
- From: Christopher Drum <email@hidden>
- Date: Tue, 17 May 2005 18:40:03 -0700
I will preface my question to the group by stating I am developing in 10.3.9 with XCode 1.5.
Please consider the following code snippet...
NSString *s = @"easy";
NSCharacterSet *cs = [NSCharacterSet characterSetWithCharactersInString:@"ABCD"];
NSRange r = [s rangeOfCharacterFromSet:cs options:NSCaseInsensitiveSearch];
NSLog(@"r.location = %i \t r.length = %i", r.location, r.length);
Given that my string contains the letter 'a' in lowercase, my custom character set contains 'A' in uppercase, and my option for rangeOfCharacterFromSet is NSCaseInsensitiveSearch, does it not follow that I should receive a valid range such that r.location = 1 and r.length = 1 ?
Despite this, I find that this code does not return a range unless the case of the string and character set match. Am I expecting too much out of NSCaseInsensitiveSearch?
Regards,
Christopher Drum
http://homepage.mac.com/christopherdrum _______________________________________________
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