I searching a way to get match count of nsstring objects for a long time.
but I can’t find.
How to get match count of String_one and String_Two?
I need your help..
NSString *String_one = @"A!B!C!D!E!F!G";
NSString *String_Two = @"BEF";
// matching progress
// :
// :
// and then result display
NSLog(@"matching count : %d",[??????]);
// result what i want.
// matching count : 3 (A!B!C!D!E!F!G vs BEF => 3 character matches)
If you want to find longest common subsequence here you have link:
http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
But if you want count only how many how many character from first string appear in second string you can write algorithm by yourself. Example: