namespace StringMatching {class Program{static void Main(string[] args){Console.WriteLine("Enter the string");string s1 = Convert.ToString(Console.ReadLine()).Trim().ToUpper();Console.WriteLine("Enter the string to be search");string s2 = Convert.ToString(Console.ReadLine()).Trim().ToUpper();int sourceIndex = 0;int searcIndex = 0;bool searchResult = false;int matchingCount = 0;while (sourceIndex < s1.Length){if (s2[searcIndex].Equals(s1[sourceIndex])){searcIndex++;sourceIndex++;searchResult = true;matchingCount++;if(matchingCount == s2.Length){break;}}else{searcIndex=0;sourceIndex++;searchResult = false;}if (sourceIndex == s1.Length) searchResult = false;}if(searchResult){Console.WriteLine("Searching string is found");}else{Console.WriteLine("Searching string is not found");}Console.ReadLine();}} }