using System.Text.RegularExpressions;
public static void Main()
string str1 = "221 James Street";
string str2 = "221 James St.";
if(str1.StartsWith(str2)){
}else if(str2.StartsWith(str1)){
bool b = str1.Like(str2+"%");
bool b2 = str2.Like(str1+"%");
Console.WriteLine(b +" "+b2);
public static class MyStringExtensions
public static bool Like(this string toSearch, string toFind)
return new Regex(@"\A" + new Regex(@"\.|\$|\^|\{|\[|\(|\||\)|\*|\+|\?|\\").Replace(toFind, ch => @"\" + ch).Replace('_', '.').Replace("%", ".*") + @"\z", RegexOptions.Singleline).IsMatch(toSearch);