Returns string with carriage return characters removed.
StripCR(string)
Parameter |
Description |
---|---|
string |
String to format |
Useful for preformatted HTML display of data (PRE) entered into textarea
fields.
<!--- This example shows StripCR ---> <html> <head> <title>StripCR Example</title> </head> <body bgcolor = "silver"> <h3>StripCR Example</h3> <p>Function StripCR is useful for preformatted HTML display of data (PRE) entered into textarea fields. <cfif isdefined("Form.myTextArea")> <pre> <cfoutput>#StripCR(Form.myTextArea)#</cfoutput> </pre> </cfif> <!--- use #Chr(10)##Chr(13)# to simulate a line feed/carriage return combination; i.e, a return ---> <form action = "stripcr.cfm" method = "POST"> <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> </body> </html>