using System.Collections.Generic;
namespace RepeatedWordCount{
public class StringProgram{
public static void Main(String[] args){
Console.WriteLine("Enter the words______");
string[] value = word.Split(new char[] { '.', '?', '!', ' ', ';', ':', ',' },StringSplitOptions.RemoveEmptyEntries);
Dictionary<string, int> RepeatedWord=new Dictionary<string,int>();
for(int i=0; i< value.Length;i++)
if(RepeatedWord.ContainsKey(value[i]))
int data=RepeatedWord[value[i]];
RepeatedWord[value[i]]=data+1;
RepeatedWord.Add(value[i],1);
Console.WriteLine("RepeatedWords and their Counts are....");
foreach(KeyValuePair<string,int> k in RepeatedWord){
Console.WriteLine("ReapeatedString ="+k.Key+" ,Counts ="+ k.Value);
foreach(char chr in word)
Console.Write("Length of the Characters in the string is : {0}\n\n", l);
Console.Write("The characters of the string in reverse are : \n");
Console.Write("{0} ", word[l]);
int words = RepeatedWord.Count;
Console.WriteLine("Total words are :"+ words );
Console.WriteLine("excepted words");
string searchTerm=Console.ReadLine();
var matchQuery = from word1 in value
where word1.Equals(searchTerm, StringComparison.InvariantCultureIgnoreCase)
int wordCount = matchQuery.Count();
Console.WriteLine("{0} occurrences(s) of the search term \"{1}\" were found.", wordCount, searchTerm);
int index = word.IndexOf(searchTerm);
Console.WriteLine("The substring no found in the given string \n");
Console.WriteLine("Found '{0}' in '{1}' at position {2}",
searchTerm, word, index);