SyntaxFix
Write A Post
Hire A Developer
Questions
This code works for me perfectly:
String numbers = text.substring(Math.max(0, text.length() - 7));