[Solved] Console Application to count all ‘#’ characters in a text file
[ad_1] The problem is that ‘#’ (symbol your looking for) is a special symbol in regular expressions and so, should be escaped: static void Main(string[] args) { //String fileName = @”C:\Documents and Settings\9chat73\Desktop\count.txt”; // To search dinamically, just ask for a file: Console.WriteLine(“Enter a file to search”); String fileName = Console.ReadLine().Trim(); if (File.Exists(fileName)) { Console.WriteLine(“Enter … Read more