how to get last 3 digits of a string in c# code example Example: c# get last two characters of string var result = str.Substring(str.Length - 2);