Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- using System.Text;
- using System.Linq;
- using System.Windows.Markup;
- using System.IO;
- namespace _01._Furniture
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- string[] command = Console.ReadLine().Split();
- while (command[0] != "End")
- {
- if (command[0] == "Translate")
- {
- if (input.Contains(command[1]))
- {
- input = input.Replace(command[1], command[2]);
- Console.WriteLine(input);
- }
- }
- if (command[0] == "Includes")
- {
- bool include = input.Contains(command[1]);
- if (include)
- {
- Console.WriteLine(include);
- }
- else
- {
- Console.WriteLine(include);
- }
- }
- if (command[0] == "Start")
- {
- bool start = input.StartsWith(command[1]);
- if (start)
- {
- Console.WriteLine(start);
- }
- else
- {
- Console.WriteLine(start);
- }
- }
- if (command[0] == "Lowercase")
- {
- input = input.ToLower();
- Console.WriteLine(input);
- }
- if (command[0] == "FindIndex")
- {
- if (input.Contains(command[1]))
- {
- int index = input.LastIndexOf(command[1]);
- Console.WriteLine(index);
- }
- }
- if (command[0] == "Remove")
- {
- int index = int.Parse(command[1]);
- int count = int.Parse(command[2]);
- input = input.Remove(index, count);
- Console.WriteLine(input);
- }
- command = Console.ReadLine().Split();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment