Re: NSString Variable Comparision
Re: NSString Variable Comparision
- Subject: Re: NSString Variable Comparision
- From: Tomas Zahradnicky <email@hidden>
- Date: Wed, 9 Jul 2003 11:15:29 -0700
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.
The simple way is:
BOOL equal = [string1 isEqualToString:string2];
BOOL equal2 = [string2 isEqualToString:string1];
or i.e.:
NSComparisonResult result = [string1 compare:string2
options:NSBackwardsSearch];
look into NSString.h for more info.
-Tomas
--
Ing. Tomas Zahradnicky, Jr.
Production Manager, 24U Software
Associate Member, Filemaker Solutions Alliance
mailto:email@hidden
http://www.24uSoftware.com
_______________________________________________
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.