Tag Archives: string comparison

(Objective C) Global Constants II

Equality can be tested with: stringInstance == MyFirstConstant, not necessary to do a string comparison (isEqualToString)

Posted in Objective-C | Also tagged , , , , , , | Leave a comment

(Python) Statistical String Comparison

http://docs.python.org/library/difflib.html

Posted in Python | Also tagged , , , , | Leave a comment

String matching and comparison in Objective-C (Cocoa Framework)

This snippet shows how to search for a string within another string and how to check if two strings are equal. NSString* needle = @”hello”; NSString* haystack = @”hello world”; NSRange matching = [haystack rangeOfString : needle]; // Searching for a string within another string if(matching.location == NSNotFound){ // Needle not found in haystack } [...]

Posted in Objective-C | Also tagged , , , , | Leave a comment