Your two strings have many strings in common, such as "30"
, "91"
, and every substring of "17602549"
. It appears you're looking for the longest substring that two strings have in common.
Google "Objective-C longest common substring", and you'll find this method on Wikibooks.