StripCR

Description

Deletes return characters from a string.

Returns

A copy of string, after removing return characters.

Category

Display and formatting functionsString functions

Function 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

<cfscript>
 x = 'Hello' & chr(13) & 'World' & chr(13); 
  y = StripCR(x); 
 writeOutput('Original: ' & x & ' Length: #len(x)#<br>' ); 
  writeOutput('Stripped: ' & y & ' Length: #len(y)#' );
</cfscript>

Output

Original: Hello World Length: 12
Stripped: HelloWorld Length: 10

 Adobe

Get help faster and easier

New user?