RSS feed

Remove Carriage Returns and Line Feeds from ASP Page

Published by: Guest (10/20/2008 2:01:05 PM)

OCT 20 2008

I have a string which seems to have line feed and carriage return at the end, i want to replace with nothing. I know there is a way to replace it but i am not very sure how to remove a carriage return and line feed from a string. If know the way then please advice me here.

 

What is Escape Function in ASP >>

<< How the Replace function Works in ASP

 

COMMENT

Name: Guest

There will be chr(13) and chr(10) so use the replace function to remove it.
str_example = replace(str_example, chr(13), chr(10))

If you are in doubt if you have such characters in the string then use escape() function to check it.

Name: Jim Davidson

Uhmmm... this is more like it:

str_example = replace(str_example, chr(13), "" )
str_example = replace(str_example, chr(10), "")

You code replaces chr(13) with chr(10)

*Name:
*Comment:
You can use HTML tags here.
*Code: Please enter the sum of 5+2