How to reverse a string value in Salesforce?

Sample Code:

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

Output:

index

Leave a Reply