string MyLine = "The Fast Cars"; if(Myline.Contains("Fast")) { //do something. }
MyLine = "The Fastest Cars"; or MyLine = "The Fastest, Cars"; or MyLine = "The xxFastest, Cars";
public static bool ContainsWord(string line, string word) { return Regex.IsMatch(line, @"\b" + word + @"\b"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)