• 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: CharacterSet: CharSet("A") - CharSetUnicode = remainder ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CharacterSet: CharSet("A") - CharSetUnicode = remainder ?


  • Subject: Re: CharacterSet: CharSet("A") - CharSetUnicode = remainder ?
  • From: Charles Srstka <email@hidden>
  • Date: Sat, 24 Apr 2010 11:38:22 -0500

On Apr 24, 2010, at 5:50 AM, Filip van der Meeren wrote:

> I want to get the difference between 2 characterSets. For example:
>
> I have the following 2 characterSets...
> NSCharacterSet *aSet = [NSCharacterSet characterSetWithCharactersInString:@"a"];
> NSCharacterSet *lowerSet = [NSCharacterSet lowercaseLetterCharacterSet];
>
> The difference between these (aSet - lowerSet = remainder):

IIRC, this line right here gets you an empty character set, which will also give you an empty set any time you make an intersection with anything:

> NSMutableCharacterSet *remainder = [[NSMutableCharacterSet alloc] init];

so this one will get the intersection between ('a') and the empty set, which will be the empty set:

> [remainder formIntersectionWithCharacterSet:aSet];

and ditto for this one. Note that even if remainder started out non-empty, it wouldn’t have more than (‘a') in it after the first intersection, and since 'a' is a member of lowerSet, being a lowercase letter, intersecting with [lowerSet invertedSet] is still going to get you an empty set:

> [remainder formIntersectionWithCharacterSet:[lowerSet invertedSet]];

What exactly are you trying to do?

Charles_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >CharacterSet: CharSet("A") - CharSetUnicode = remainder ? (From: Filip van der Meeren <email@hidden>)

  • Prev by Date: Re: showing a list of mounted volumes with icon
  • Next by Date: NSTableview background image for column?
  • Previous by thread: CharacterSet: CharSet("A") - CharSetUnicode = remainder ?
  • Next by thread: Re: CharacterSet: CharSet("A") - CharSetUnicode = remainder ?
  • Index(es):
    • Date
    • Thread