// Compare string 1 case-insensitive
Nsstring * astring01 = @ "this is a string! ";
Nsstring * astring02 = @ "this is a string! ";
Bool result = [astring01 caseinsensitivecompare: astring02] = nsorderedsame;
Nslog (@ "Result: % d", result );
// Nsordereddescending determines the size of the two object values (which are compared alphabetically. astring02 is true if it is smaller than astring01)
// Compare string 2 without case sensitivity
Nsstring * astring01 = @ "this is a string! ";
Nsstring * astring02 = @ "this is a string! ";
Bool result = [astring01 compare: astring02
Options: nscaseinsensitivesearch | nsnumericsearch] = nsorderedsame;
Nslog (@ "Result: % d", result );
// Nscaseinsensitivesearch: case-insensitive comparison nsliteralsearch: performs a full comparison. case-sensitive nsnumericsearch: compares the number of characters of a string, not the character value.