To truncate string using apex in Salesforce
String str = ‘sfdcblog’;
String trucatedStr = str.substring(0,3);
Cheers!!!
String str = ‘sfdcblog’;
String trucatedStr = str.substring(0,3);
Cheers!!!