using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Programming.CharacterOccurence { class Test { static void Main() { String input = "Web Developer"; string ChartoFind = "r"; int totallengthofinput = input.Length; int LengthOfInputWithOutCharToFind = input.Replace(ChartoFind, "").Length; int resultcount = totallengthofinput - LengthOfInputWithOutCharToFind; Console.WriteLine("Number of times occured the character r occured is : {0}", resultcount); Console.ReadLine(); } } }
Here you can find solution of your code problem & errors.