c# check last 3 charcters of a string code example
Example 1: c# get last character of string
string str = "Hello World";
string substr = str.Substring(str.Length - 1);
Example 2: last two characters of string c#
string str = "Hello World";
string substr = str.Substring(str.Length - 2);