I am trying to make "weighted" list of letters as words are created. I have a massive list of words in an NSArray. For example I am trying to acquire a new NSArray filled with just the 3rd letters of all the words based off the first two letters entered.
So far I have...
NSArray *filteredArray;
if (currentWordSize == 0) {
filteredArray = wordDictionary
}
else {
NSPredicate *filter = [NSPredicate predicateWithFormat:@"SELF beginswith[cd] %@", filterString];
filteredArray = [wordDictionary filteredArrayUsingPredicate:filter];
}
And that works all good for putting whole words into the filtered array, but that isn't exactly what I need. Can anyone show me a way to just fill the filteredArray
with just the 1st, 2nd, or 3rd letters of a random NSString
from the wordDictionary
?
EDIT: clarified my question.