Last updated on
Description
Replaces characters in a string:
- Single newline characters (CR/LF sequences) with spaces
- Double newline characters with HTML paragraph tags (<p>)
Returns
A copy of the string, with characters converted.
Category
Display and formatting functions, String functions
Function syntax
ParagraphFormat(string)
See also
Parameters
Parameter |
Description |
---|---|
string |
A string or a variable that contains one |
Usage
This function is useful for displaying data entered in textarea fields.
Example
<cfscript> myText="This is my block of text. It has both single newline characters in it like this paragraph, and double newline characters like in the next paragraph. This is the paragraph with the double newline characters." writeOutput(ParagraphFormat(myText)) </cfscript>
Output
This is my block of text. It has both single newline characters in it like this paragraph, and double newline characters like in the next paragraph.
This is the paragraph with the double newline characters.