Here is source code of the C# Program to Find the Frequency of the Word ʺisʺ in a given Sentence. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
* C# Program to Find the Frequency of the Word ʺisʺ in a given Sentence
public static void Main()
Console.WriteLine("Enter the String : ");
s1 = Console.ReadLine();
public static class counting
public static int CountStringOccurrences(string text, string pattern)
int count = 0;
int i = 0;
while ((i = text.IndexOf(pattern, i)) != -1)
i += pattern.Length;
Here is the output of the C# Program:
Enter the String : Rose is a Flower 1
Sanfoundry Global Education & Learning Series – 1000 C# Programs.