ads

Thursday, 7 December 2017

Get last N digits from a String using Apex in Salesforce


right() : Used to get last n digits from a String using Apex.

Syntax Used :
txtSting.right(n);


Explanation :

String txtString = 'sfdcforyou';
String FinalStr = txtString.right(6);
system.debug('FinalStr ===>'+FinalStr); //Return foryou

Debug Output :






No comments:

Post a Comment