My method currently checks if a substring exists within an array, but I was wondering if there's a way for it to also work with punctuation and numbers. Say I have an array of:
@[@"apple", @"!!", @"apps!", @"banana"];
and my substring is @"!"
, I want it to spit out: @"!!"
, and @"apps!"
Or another example:
@[@"apple", @"6:30", @"6 Pizzas", @"26"];
and my substring is @"6"
, I want it to spit out: @"6:30"
, and @"6"
, and @"6 Pizzas"
Is there a way of doing this using NSRange substringRange = [wordsArray rangeOfString:currentWord];
At the moment punctuation characters aren't being recognized. :/
Using
NSPredicates
makes this work much easier.