How to remove unwanted linefeeds and carriage returns?
I get an old recordset from the sql server database.
And I use server side vbcode to write javascript onto a webpage.
The problem I get is that in some of the records I find CR and LF, that makes the javascript garbage...
For every string I write in the javascript, I perform a replace using \n
But yet the LF and CR remains. I checked the output in the hex editor and I find both 0D and 0A... and yet the replace method has replaced the \n with a blank...
So, are there any other ways in vb to completly get rid of the Carraige returns??
kind regards
Henrik
Re: How to remove unwanted linefeeds and carriage returns?
Try replacing \n and \r as well.
Re: How to remove unwanted linefeeds and carriage returns?
I haven't tried using regular expressions... does anyone know how to write a reg exp that matches all occurences of carraige return? then i use the string.replace method
kind regards
Henrik
Re: How to remove unwanted linefeeds and carriage returns?
string sRegularExpression = "([\\n\\r]+)"; //Match either of x0D or x0A one or more times.
Re: How to remove unwanted linefeeds and carriage returns?