Re: CharacterSet: CharSet("A") - CharSetUnicode = remainder ?
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