I am working with a C# Windows form application. Can anyone help me with the fastest way to detect if more than 'x' number of alphabets of string one are present in string two in same pattern & vice versa.
Example: "dog" in "puppydogphotos.jpg" would count as a detection.
I am doing something like below but its failing on some instances:
foreach (var word in Kewords.Split(','))
{
var filename = Path.GetFileNameWithoutExtension(e.FullPath).ToLower();
var extenion = Path.GetExtension(e.FullPath).ToLower();
if (word.ToLower().Contains(filename) || word.ToLower().StartsWith(filename) || word.ToLower().EndsWith(filename) || word.Contains(extenion) || filename.ToLower().Contains(word.ToLower()) ||filename.ToLower().StartsWith(word) || filename.ToLower().EndsWith(word))
{
keywordMatch = true;
}
}
Thanks