public static bool FuzzyMatch(string stringToSearch, string pattern)
var patternLength = pattern.Length;
var strLength = stringToSearch.Length;
while (patternIdx != patternLength && strIdx != strLength)
if (char.ToLower(pattern[patternIdx]) == char.ToLower(stringToSearch[strIdx]))
Console.WriteLine(patternLength + "test" + strLength + patternIdx + patternLength);
return patternLength != 0 && strLength != 0 && patternIdx == patternLength;
public static bool Compute(string s, string t)
int[,] d = new int[n + 1, m + 1];
for (int i = 0; i <= n; d[i, 0] = i++)
for (int j = 0; j <= m; d[0, j] = j++)
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
int cost = (t[j - 1] == s[i - 1]) ? 0 : 1;
Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1),
return d[n, m] < t.Length-1;
public static void Main()
var db = new string[8] {"google", "bing", "facebook", "linkedin", "twitter", "googleplus", "bingnews", "plexoogl"};
foreach(var dbitem in db){
if(Compute("gge", dbitem)){
Console.WriteLine("its a match => "+dbitem);
Console.WriteLine("Its not a match");