How to get last 10 numbers from a String using Apex in Salesforce ? We believe in growing together ! › Forums › Superbadges Help and Discussions › How to get last 10 numbers from a String using Apex in Salesforce ? Tagged: #phone #mobile #string This topic has 1 reply, 1 voice, and was last updated 1 year, 12 months ago by Admin. Viewing 2 posts - 1 through 2 (of 2 total) Author Posts 10 December 2021 at 6:36 am #1437 Reply AdminKeymaster How to get last 10 numbers from a String using Apex in Salesforce to get a valid ten digit number and also add +91? 10 December 2021 at 6:36 am #1438 Reply AdminKeymaster We can use right(n) command to get last n digits from a String using Apex. Syntax: str.right(n); Example: String strphoneNumber = ‘917718838553’; string phnumber = strphoneNumber.right(10); string phonewithCode = ’91’+strphoneNumber.right(10); Author Posts Viewing 2 posts - 1 through 2 (of 2 total) Reply To: How to get last 10 numbers from a String using Apex in Salesforce ? Your information: Name (required): Mail (will not be published) (required): Website: Submit