Case insensitive comparison NSString

Tejaswi Yerukalapudi picture Tejaswi Yerukalapudi · Apr 6, 2010 · Viewed 111.5k times · Source

Can anyone point me to any resources about case insensitive comparison in Objective C? It doesn't seem to have an equivalent method to str1.equalsIgnoreCase(str2)

Answer

Jason Coco picture Jason Coco · Apr 6, 2010
if( [@"Some String" caseInsensitiveCompare:@"some string"] == NSOrderedSame ) {
  // strings are equal except for possibly case
}

The documentation is located at Search and Comparison Methods