how to check last character of a string in c# code example Example: get last character of string c# str = str.Substring(str.Length - 1);