private int TagCompare(string?str1, string?str2) { if (str1 == null || str2 == null) { return(int.MaxValue); } return(StringCompare.LevensteinDistance( string.Join(" ", str1.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).OrderBy(name => name)), string.Join(" ", str2.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).OrderBy(name => name)) )); }
private int IngredientCompare(string str1, string str2) => StringCompare.LevensteinDistance( string.Join(" ", str1.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).OrderBy(name => name)), string.Join(" ", str2.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).OrderBy(name => name)) );