c# take 7 last code example Example: last two characters of string c# string str = "Hello World"; string substr = str.Substring(str.Length - 2);