• 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
Re: case-insensitive strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: case-insensitive strings


  • Subject: Re: case-insensitive strings
  • From: Nat! <email@hidden>
  • Date: Fri, 11 Oct 2002 01:39:23 +0200

Am Montag, 07.10.02 um 19:32 Uhr schrieb Matt Neuburg:

I'd like to have a kind of NSString where isEqual: is case-insensitive. The
reason I want this is so that when such a string is an object in a
dictionary, allKeysForObject will work case-insensitively. For example, if
I have a dictionary where both keys and objects are strings, like this:

yo: Hello
ha: Haha

...then if I say [dict allKeysForObject: @"hello"] I'd like to get back an
array consisting of @"yo".

Is there an elegant and safe way to do this? You'd think there would be a
way to tell an individual string to flip case sensitivity off for the
purpose of all comparisons, but there doesn't seem to be one built in. m.
--

This may or may not help :)

consider using a second reverse dictionary for value -> key lookup

consider using only uppercase converted strings as keys, and only accessing said twin dictionaries with such keys.

Ciao
Nat!



Jedenfalls sind zehn Fehlstarts hintereinander [E. Fuchs]
ein sehr interessanter Beweis
fuer unsere Theorie
von der natuerlichen Ueberlegenheit des Dezimalsystems
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >case-insensitive strings (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: is protected broken, or am I?
  • Next by Date: Re: NSTextView, NSTextStorage, NSParagraph and lineHeight
  • Previous by thread: Re: case-insensitive strings
  • Next by thread: Re: case-insensitive strings
  • Index(es):
    • Date
    • Thread