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;
- using System.Threading.Tasks;
- namespace ConsoleApp3
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine().ToLower();
- string pattern = Console.ReadLine().ToLower();
- int counter = 0;
- int index = input.IndexOf(pattern);
- while (index != -1)
- {
- counter++;
- index = input.IndexOf(pattern, index + 1);
- }
- Console.WriteLine(counter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement