c# get last symbol of string code example
Example 1: c# get last character of string
string str = "Hello World";
string substr = str.Substring(str.Length - 1);
Example 2: get last character of string c#
str = str.Substring(str.Length - 1);
Example 3: c# get last 3 characters of string
var result = input.Substring(input.Length - 3);
Example 4: c# get last character of string
mystring.Substring(mystring.Length - 4);