xxxxxxxxxx
// str = "Hello world";
var result = str.Substring(str.Length - 2);
// result = "ld"
xxxxxxxxxx
string str = "Hello World";
string substr = str.Substring(str.Length - 1);
xxxxxxxxxx
string mystring = "Hellopeople";
string lastFour = mystring.Substring(mystring.Length - 4 , 4);
Console.WriteLine(lastFour);
xxxxxxxxxx
string str = "Hello World";
string substr = str.Substring(str.Length - 2);