I am trying to convert the Long Area Text in to the RTF Field, the long text area sometime has the the <> in between the texts which is treated as a markup. I tried below to escape the characters like below
newArticle.Article_Body_Long_T__c = result.SolutionNote;
String rep = newArticle.Article_Body_Long_T__c.replaceAll('<', '\<');
rep = newArticle.Article_Body_Long_T__c.replaceAll('>', '\>');
newArticle.SOP_Article_Body__c = rep.replaceAll('\n', '<br/>');
But it throws error like Illegal string literal: Invalid string literal '\<'. Illegal character sequence \<' in string literal.
I want the <> braces retained in the RTF and cannot replace them with the '' empty string. Please let me how I can I handle this
result.SolutionNote
to the question that replicates the problem?<
with<
?