SyntaxFix
Write A Post
Hire A Developer
Questions
One way is to use the Length property of the string as part of the input to Substring:
Length
Substring
string sub = input.Substring(input.Length - 5); // Retrieves the last 5 characters of input