Just enumerate through the characters in the string and delete matching ranges. Be sure to search 'caselessly' (ie the difference between uppercase and lowercase letters is irrelevant). The following snippet logs "Djaha", as the opening post expects.
NSString *firstString = @"Deja Thoras";
NSString *secondString = @"Optimus Prime";
NSMutableString *outputString = [NSMutableString stringWithString:firstString];
[outputString enumerateSubstringsInRange:NSMakeRange(0, firstString.length) options:NSStringEnumerationByComposedCharacterSequences
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
if ([secondString rangeOfString:substring options:NSCaseInsensitiveSearch].location != NSNotFound) {
[outputString deleteCharactersInRange:substringRange];
}
}];
NSLog(@"%@", outputString);
If this is a common operation, I would place the code into a category, with a method name like stringByRemovingMatchingCharactersInString: