You need to sign in to do that
Don't have an account?

How to get a rich text area Content
Hi All,
I need to get the content of Rich Text Area Field without HTML markup when i query the field. Is there any method to get the text data excluding the markup?
Thank you in Advance,
Best Regards,
NHK
try this
String richTextVal = '<p><b>text</b></p>';
String RegEx ='(</{0,1}[^>]+>)';
richTextVal = richTextVal.replaceAll(RegEx, '');
system.debug(richTextVal);
Hi Amilaw,
Thank you for your reply.
If we use RegEx function, we canot retain the values with quot.
For Ex: richTextVal = <b> "This is a text value" </b>
Then the result will be like "This is a text value"
Best Regards,
NHK
Hi All,
Let me explain my scenario.
We have a custom object with few Rich Text Fields. We are using a middleware to query the records of custom object and sending it to a tool which Prepares a PPT out of it. Since the Rich Text field value is stored as HTML markup, the PPT is not displying properly. We need to avoid the markup and display only the Text data.
If anyone have any ideas, please share it.
Thank you,
Best Regards,
NHK
are you sure. for me result was as expected
String richTextVal = '<p class="tst"><b>"text"</b></p>';
String RegEx ='(</{0,1}[^>]+>)';
richTextVal = richTextVal.replaceAll(RegEx, '');
system.debug(richTextVal);
resulted --> "text"
did you used any string html methods