How to write Example code for comparing Strings in iPhone SDK?

Ads
 

How to write Example code for comparing Strings in iPhone SDK?

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

View Answers

April 1, 2015 at 4:31 AM

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









Related Tutorials/Questions & Answers:
How to write Example code for comparing Strings in iPhone SDK?
iPhone SDK Comparing Strings
Advertisements
Iphone Comparing Strings
How to write Example code for CRUD application in hibernate annotation?
Comparing strings - Java Beginners
how to write code for this output?
How to write first example in Ajax?
uialertview example iphone
Comparing Strings in a Locale-Independent Way
How to write jsp/servlet code to integrate LINKDIN?
How to write first JSP Hello World example?
how to write a programm in C for included code below
How to write the code for date in swings - Struts
How to write a session code - Java Beginners
How to write a error.jsp code - Java Beginners
How to Write to a File in Java without overwriting
How to write hello world example program in Hibernate?
How to write the junit test code for the following controller code
how to write weighted moving average code using 2d-array
Comparing two Dates in Java with the use of before method
Character Comparison Example
how to write function of copy from one to another location in this code
UINavigationBar Color - iPhone example
info button iphone example
iPhone - MFMailcomposeviewcontroller example
how to write a code for oracle database connection in asp.net for validation.
strings
MapView Example in iPhone
How to Convert NSStringe into Uppercasestring iPhone
How to Make iPhone Window Application
Current Date iPhone SDK

Ads