Whatever message this page gives is out now! Go check it out!

StripCR

Last update:
May 18, 2026

Description

Deletes return characters from a string.

Returns

A copy of string, after removing return characters.

Category

Function syntax

StripCR(string)

See also

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

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page