Re: NSString Variable Comparision
Re: NSString Variable Comparision
- Subject: Re: NSString Variable Comparision
- From: John Lombardo <email@hidden>
- Date: Thu, 10 Jul 2003 02:20:16 +0800
You'll need to use the NSComparisonMethods.
The methods you'll be interested in are isLike: and isCaseInsensitiveLike:.
The best thing is you can use wildcards, so...
NSString *string_a = @"f*ck";
NSString *string_b = @"fire truck";
If ([string_a isLike:string_b]){
/* stuff */
}
John
On 10/7/03 1:04 AM, "Vibhu Mishra" <email@hidden> wrote:
>
Greetings again,
>
Can I compare two NSString Variables, if so how do I do it?
>
I believe for two integer, float etc variables, we use
>
if (int a == int b){
>
//
>
}
>
What do I do for two NSString variables.
>
>
...
>
Vibhu
>
_______________________________________________
>
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.
_______________________________________________
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.