Matching a string based on similarity i.e. not exact match

Thanks vvaidya! although, I couldn’t get the Except and Intersect to work, but I probably did something wrong.

Here is an alternative that I came up with:

(str1.Where(Function(s) str2.Contains(s) ).Count / str2.Count)*100

That will return the percentage of characters that are contained in your main string str2. So you can use that in an If condition.

Regards, @mario

6 Likes