How to reverse a string in Salesforce?

Sample Code:

String str = 'abc';
String revStr = str.reverse();
system.debug('Reversed string is ' + revStr);

Output:


Cheers!!!

No comments:

Post a Comment