Removes all markup from an RTF document and returns it's plain text.
Syntax
Text = SRP_String("StripRTF", RTF)
Parameters
Parameter | Description |
---|---|
RTF | The RTF marked up text. (REQUIRED) |
Returns
The plain text of an RTF document
Remarks
The StripRTF service removes all markup from an RTF document. This service assumes you've already read the RTF document into a variable and passed it in via the RTF property. If the incoming text is not perceived to be RTF, then this service returns the text you passed as is.
Example
// Sample RTF Rtf = "{\rtf1\ansi\deff0":Crlf$ Rtf := "{\colortbl;\red0\green0\blue0;\red255\green0\blue0;}":Crlf$ Rtf := "This line is the default color\line":Crlf$ Rtf := "\cf2":Crlf$ Rtf := "This line is red\line":Crlf$ Rtf := "\cf1":Crlf$ Rtf := "This line is the default color":Crlf$ Rtf := "}" // Returns the following: // This line is the default color // This line is red // This line is the default color Ans = SRP_String("StripRTF", Rtf)