c# get last element of string code example Example: get last character of string c# str = str.Substring(str.Length - 1);