I want to copy data from RichText Area field to Text Area field,When I copied in Text area field,The data is displaying with HTMl tags. How can I convert this?

edited to add code from comment

new CaseComment(ParentId = cs.Id,CommentBody = lct.Body)

I'm using this in a Trigger. Here CommentBody is Text Area, Body is Rich Text area

  • Please add some detail here. If you are doing this with Apex, show us the code. If the copy is by some other means, please explain. – Jagular Jul 3 '14 at 14:12
  • new CaseComment(ParentId = cs.Id,CommentBody = lct.Body),I'm using this in Trigger.here CommentBody is Text Area,Body is Rich Text area. – User1511 Jul 3 '14 at 15:43

If you just want to get rid of the HTML tags, how about replace them with empty strings using String.replaceAll?

String.replaceAll('\\<.*?\\>', '');

If this is not what you are looking for, you should as well add the example of your code, your current result and your expected result.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.