• 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
NSCharacterSet and NSCaseInsensitiveSearch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Figuring out which values are selected in an NSTableView
  • Next by Date: CoreData and arrays owned by arrays...
  • Previous by thread: Re: Figuring out which values are selected in an NSTableView
  • Next by thread: CoreData and arrays owned by arrays...
  • Index(es):
    • Date
    • Thread