Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- namespace CSharp_Shell
- {
- public static class Program
- {
- public static void Main()
- {
- var raw = Console.ReadLine();
- var substring = String.Empty;
- while(true)
- {
- var input = Console.ReadLine();
- if(input=="Generate")
- {
- break;
- }
- var command = input.Split(">>>");
- if(command[0] == "Contains")
- {
- substring = command[1];
- if(raw.Contains(substring))
- {
- Console.WriteLine($"{raw} contains {substring}");
- }
- else
- {
- Console.WriteLine("Substring not found!");
- }
- }
- if(command[0] == "Flip")
- {
- if(command[1] == "Upper")
- {
- var startIndex = int.Parse(command[2]);
- var endIndex = int.Parse(command[3]);
- var length = endIndex-startIndex;
- substring = raw.Substring(startIndex, length);
- var curr = raw.Replace(substring, substring.ToUpper());
- raw = curr;
- Console.WriteLine(raw);
- }
- if(command[1] == "Lower")
- {
- var startIndex = int.Parse(command[2]);
- var endIndex = int.Parse(command[3]);
- var length = endIndex - startIndex;
- substring = raw.Substring(startIndex, length);
- var curr = raw.Replace(substring, substring.ToLower());
- raw = curr;
- Console.WriteLine(raw);
- }
- }
- if(command[0] == "Slice")
- {
- var startIndex = int.Parse(command[1]);
- var endIndex = int.Parse(command[2]);
- var length = endIndex - startIndex;
- var curr = raw.Remove(startIndex, length);
- raw = curr;
- Console.WriteLine(raw);
- }
- }
- Print(raw);
- }
- public static void Print(string raw)
- {
- Console.WriteLine($"Your activation key is: {raw}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement