Problem

A company, XCorp recently integrated their salesforce with SAP has a requirement to replace the html tags from account description. The accounts are created in salesforce via REST API integration.


The SAP system uses html line breaks (<br/>)tags in order to display the account details in multiple lines. As the salesforce account description is a text field, the html characters don't render as multi lines in the salesforce screens.


Replace all line breaks in the account description with commas (',') to neatly display the account description on salesforce screens.


Instruction:


If the account description contains html tag <br/> then, replace all occurrence of <br/> tags in the account description with ‘,’


Complete the given apex method to replace all <br/> tags and return the account description.


Example:


//Account description : Financial service account with 30k+ customers <br/> strong financial background <br/> currently in discussion for an acquisition

String accDesc = accountReplaceTextController.replaceHtmlChars(String accountDesc);

//accDesc = Financial service account with 30k+ customers , strong financial background , currently in discussion for an acquisition


Note: This exercise is designed to introduce you to writing a simple apex method for replacing characters in a given string. Concentrate on implementing a solution using apex string methods. Feel free to validate your code by clicking the execute button.