StripCR

Description

Deletes return characters from a string.

Return value

A copy of string, after removing return characters.

Category

Display and formatting functions, Other functions, String functions

Syntax

StripCR(string)

See also

ParagraphFormat

Parameters

Parameter Description
string
A string or a variable that contains one

Usage

Useful for preformatted (between <pre> and </pre> tags) HTML display of data entered in textarea fields.

Example

<h3>StripCR Example</h3>

<p>Function StripCR is useful for preformatted HTML display of data 
(PRE) entered in textarea fields.
<cfif isdefined("Form.myTextArea")>

<pre>
<cfoutput>#StripCR(Form.myTextArea)#</cfoutput>
</pre>
</cfif>
<!--- use #Chr(10)##Chr(13)# to simulate line feed/carriage return combination --->
<form action = "stripcr.cfm">
<textarea name = "MyTextArea" cols = "35" rows = 8>
This is sample text and you see how it scrolls
  <cfoutput>#Chr(10)##Chr(13)#</cfoutput>
From one line 
  <cfoutput>#Chr(10)##Chr(13)##Chr(10)##Chr(13)#</cfoutput> 
to the next
</textarea>
<input type = "Submit" name = "Show me the HTML version">
</form>

ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt286.htm