string[] data={"W","H","X","V"} string X="W"; countTrue(data,X); public int countTrue(string[] data, string X) { var results = from p in data where !p.Contains(X) select p; return results.Count(); }
public int countTrue(string[] data, string X) { bool results = data.Any(A=>!A.Equals(X,StringComparison.OrdinalIgnoreCase)); return results?1:0; }
public string FirstNonMatch(string[] data, string X) { return data.FirstOrDefault(i => ! i.Contains(X)); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)