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

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy