Re: NSString Variable Comparision
Re: NSString Variable Comparision
- Subject: Re: NSString Variable Comparision
- From: "Clark S. Cox III" <email@hidden>
- Date: Wed, 9 Jul 2003 13:58:03 -0400
On Wednesday, July 09, 2003, at 13:04, Vibhu Mishra 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.
If you want to know if the contents of the two strings are the same,
then use:
if([stringA isEqualToString: stringB])
{
//
}
If you want to know if the two variables point to the same string
object, then use:
if(stringA == stringB)
{
//
}
I strongly suspect that you want the first one.
--
http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
_______________________________________________
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.