Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- string str1, str2;
- Console.WriteLine("Type the containing string");
- str1 = Console.ReadLine().ToLower();
- Console.WriteLine("Type A string to be found in the earlier string");
- str2 = Console.ReadLine().ToLower();
- Console.WriteLine("Result is "+ str1.IndexOf(str2).ToString() );
- Console.WriteLine("");
- Console.WriteLine("Any key to loop, exit to exit");
- if (Console.ReadLine().ToLower() == "exit") break;
- Console.WriteLine("");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement