Re: Wildcard in NSString
Re: Wildcard in NSString
- Subject: Re: Wildcard in NSString
- From: Chris Hanson <email@hidden>
- Date: Fri, 4 Jul 2003 10:59:17 -0500
On Friday, July 4, 2003, at 06:54 AM, Partha wrote:
I have two NSStrings, say, @"ABCD" and @"A*D". The '*' character in
the second
NSString is actually a wildcard. Is there any simple method, which,
when these
strings are compared, will return YES?
@protocol NSComparisonMethods
- (BOOL)isLike:(NSString *)string;
- (BOOL)isCaseInsensitiveLike:(NSString *)string;
@end
These methods do shell-style "globbing" of '*' and '?' characters, and
have working implementations in NSString.
I use them in BDQualifier <
http://bdistributed.com/Projects/BDControl/>.
-- Chris
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
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.