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 ConsoleApplication30
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("input yor first split char: ");
- ConsoleKeyInfo usrKey1 = Console.ReadKey();
- Console.WriteLine();
- Console.WriteLine("input yor second split char: ");
- ConsoleKeyInfo usrKey2 = Console.ReadKey();
- Console.WriteLine();
- int count = 0;
- Console.WriteLine("input your string: ");
- string str = Console.ReadLine();
- for (int i = str.IndexOf(usrKey1.KeyChar) + 1; i < str.LastIndexOf(usrKey2.KeyChar); i++)
- count++;
- Console.WriteLine(count);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement