How to get last n digits from a String using Apex in Salesforce?

right() is used to get last n digits from a String using Apex.

Syntax:
str.right(n);

Example:
String str = 'abcd';
system.debug(str.right(3)); // returns bcd

No comments:

Post a Comment