I have an object of NSString class and I want to compare it with another NSString object.
How to compare NSString object with another NSSTring object?
Thanks
The NSString object provides a method isEqualToString which is used to compare the two string.
Following code can be used:
if([str1 isEqualToString: str2]){
This method compares the string with the str2 and returns TRUE if it is equal and FALSE if it is not matching.
Check the complete code with examples at iPhone SDK Comparing Strings.
Thanks
Ads