How to truncate string using apex in Salesforce?

To truncate string using apex in Salesforce

String str = 'sfdcblog';
String trucatedStr = str.substring(0,3);


Cheers!!!

1 comment:

  1. Hi

    can you please explain it little bit.

    Thank you

    ReplyDelete