You need to sign in to do that
Don't have an account?
khillan bhardwaj
Getting Plain text from rtf text in trigger
Hi,
I want to get plainText from rtf text in the trgger.the rtf text is present the the custom fields as below:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Tahoma;}} {\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\f0\fs17 Ben called with updated CC info 7/3/14...going forward use\par \par 4856 3100 1190 8431 \par exp 12/16 \fs17 }
Can any let me know how to get plainText from this rtf text.
Thanks
Khillan
I want to get plainText from rtf text in the trgger.the rtf text is present the the custom fields as below:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Tahoma;}} {\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\f0\fs17 Ben called with updated CC info 7/3/14...going forward use\par \par 4856 3100 1190 8431 \par exp 12/16 \fs17 }
Can any let me know how to get plainText from this rtf text.
Thanks
Khillan
stripHtmlTags(); method of string eliminate html tags only.It does not work for rtf text.
Thanks
What exactly your requirment you need to assign the richtextArea value to TextArea right ? and the value in you RichTextArea is that you have given above .
I think the method sura has given will work that I have already used before .
Check with below poc .it is working .
I have richText value in textArea field. I need to remove rich text to extract the usable information.
For Example in the textArea i have value as below:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Tahoma;}} {\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\f0\fs17 Ben called with updated CC info 7/3/14...going forward use\par \par 4856 3100 1190 8431 \par exp 12/16 \fs17 }
From this rtf text i need to extract information:
Ben called with updated CC info 7/3/14...going forward use
4856 3100 1190 8431
exp 12/16
but the method you provide stripHtmlTags remove only html tags only.
Hope this make sense.
Thanks