namespace WorkingWithStrings
static void Main(string[] args)
string poezie = "vers1 " +
Console.WriteLine(poezie2);
static void RemoveByIndex()
Console.WriteLine("Give the string");
string s = Console.ReadLine();
Console.WriteLine("Give the index");
int index = Int32.Parse(Console.ReadLine());
toModify = s.Remove(index, 1);
Console.WriteLine("Wrong index");
Console.WriteLine($"{s} became {toModify}");
static void RemoveOddIndexes()
Console.WriteLine("Give the string");
string source = Console.ReadLine();
for (i=0;i<source.Length;i=i+2)
destination += source[i];
Console.WriteLine($"The new string is: {destination}");
Console.Write("Insert the first string: ");
string s1 = Console.ReadLine();
Console.Write("Insert the second string: ");
string s2 = Console.ReadLine();
Console.WriteLine($"{s1} say : I'm the first.");
} else if (s1.CompareTo(s2) == 0)
Console.WriteLine($"{s1} say : We are the same.");
Console.WriteLine($"{s1} say : I'm not the first one");
public static void Extract()
Console.Write("How many characters do you want to extract? ");
int length = Int32.Parse(Console.ReadLine());
Console.Write("Where should I start? ");
int index = Int32.Parse(Console.ReadLine());
Console.WriteLine("Insert the string");
string source = Console.ReadLine();
if (index + length <= source.Length)
string result = source.Substring(index, length);
Console.WriteLine($"The substring is {result}");
if (result.Equals("test"))
Console.WriteLine("I am test");
Console.WriteLine("The dimension that you ask exced the length of the input string");