Salesforce Apex String replace function Biswajeet April 13, 2015 No Comments on Salesforce Apex String replace function Here is sample Code: String str = 'biswajeet'; system.Debug(str.replace('b','-').replace('e', '*')); Output: