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

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 Comparing Strings
Advertisements
How to write Example code for CRUD application in hibernate annotation?
how to write code for this output?
uialertview example iphone
How to write first example in Ajax?
how to write a programm in C for included code below
How to write jsp/servlet code to integrate LINKDIN?
How to write first JSP Hello World example?
How to write hello world example program in Hibernate?
How to Write to a File in Java without overwriting
How to write the junit test code for the following controller code
info button iphone example
iPhone - MFMailcomposeviewcontroller example
how to write function of copy from one to another location in this code
Comparing two Dates in Java with the use of before method
Character Comparison Example
how to write a code for oracle database connection in asp.net for validation.
write code in c#
iPhone Radio Button Example
Write JQUERY Code
Write JQUERY Code
How to Make iPhone Window Application
Hire developers to write an iPhone Android application
strings
How to Convert NSStringe into Uppercasestring iPhone
help to write java code
help to write java code
how to write the coding for converting the database data for example population into any type of graph using jsp and servlets?//
I need jsp code for how to write text field value into property file.
compare two strings in java

Ads