string str = "Hello World";
string substr = str.Substring(str.Length - 1);
string mystring = "Hellopeople";
string lastFour = mystring.Substring(mystring.Length - 4 , 4);
Console.WriteLine(lastFour);
str = str.Substring(str.Length - 1);
var result = input.Substring(input.Length - 3);
string msg = "Hello";
string last_char = msg[^1..];
Console.WriteLine(last_char); // output: o
mystring.Substring(mystring.Length - 4);