Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- namespace _02._Boss_Rush
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- string[] command = Console.ReadLine().Split();
- while (command[0] != "Done")
- {
- if (command[0] == "Change")
- {
- input = input.Replace(command[1], command[2]);
- Console.WriteLine(input);
- }
- if (command[0] == "Includes")
- {
- bool includes = input.Contains(command[1]);
- Console.WriteLine(includes);
- }
- if (command[0] == "End")
- {
- bool end = input.EndsWith(command[1]);
- Console.WriteLine(end);
- }
- if (command[0] == "Uppercase")
- {
- input = input.ToUpper();
- Console.WriteLine(input);
- }
- if (command[0] == "FindIndex")
- {
- int index = input.IndexOf(command[1]);
- Console.WriteLine(index);
- }
- if (command[0] == "Cut")
- {
- int index = int.Parse(command[1]);
- int lenght = int.Parse(command[2]);
- input = input.Substring(index, lenght);
- Console.WriteLine(input);
- }
- command = Console.ReadLine().Split();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement