while ((line = file.ReadLine()) != null) { if (line.Contains("FIT")) { Console.WriteLine(counter.ToString() + ": " + line); } counter++; file.Close(); }
using System.Text.RegularExpressions; // add this at the top of your code file
if (Regex.IsMatch(line, @"\bFIT\b")) { Console.WriteLine(counter.ToSring() + ": " + line); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)