Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net.Http.Headers;
- using System.Security.Claims;
- using System.Text.RegularExpressions;
- namespace softuni_Regex
- {
- class Program
- {
- static void Main(string[] args)
- {
- string command;
- string input = Console.ReadLine();
- while ((command = Console.ReadLine()) != "For Azeroth")
- {
- if (command == "GladiatorStance")
- {
- input = input.ToUpper();
- Console.WriteLine(input);
- }
- else if (command == "DefensiveStance")
- {
- input = input.ToLower();
- Console.WriteLine(input);
- }
- else if (command.Contains("Dispel"))
- {
- string[] splitted = command.Split();
- int index = int.Parse(splitted[1]);
- char letter = Char.Parse(splitted[2]);
- if (index >= 0 && index < input.Length)
- {
- input = input.Replace(input[index], letter);
- Console.WriteLine("Success!");
- }
- else
- {
- Console.WriteLine("Dispel too weak.");
- }
- }
- else if (command.Contains("Target Change"))
- {
- string[] splitted = command.Split();
- string firstSubstring = splitted[2];
- string secondSubsstring = splitted[3];
- input = input.Replace(firstSubstring, secondSubsstring);
- Console.WriteLine(input);
- }
- else if (command.Contains("Remove"))
- {
- string[] splitted = command.Split();
- string remove = splitted[2];
- input = input.Replace(remove, "");
- Console.WriteLine(input);
- }
- else
- {
- Console.WriteLine("Command doesn't exist!");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment