ads

Friday, 8 December 2017

Replace function in String using Apex in Salesforce


Explanation :


String OldStr = 'SFDCFORYOUDOTCOM';
String NewStr = OldStr.replace('F','@@@').replace('D', '&&&&');

System.Debug('NewStr====>'+NewStr);


Debug Output :





No comments:

Post a Comment