|
-
Oct 25th, 2005, 08:21 AM
#1
Thread Starter
Frenzied Member
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
-
Oct 25th, 2005, 08:45 AM
#2
Re: How to remove unwanted linefeeds and carriage returns?
Try replacing \n and \r as well.
-
Oct 25th, 2005, 08:46 AM
#3
Thread Starter
Frenzied Member
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
-
Oct 25th, 2005, 12:43 PM
#4
Re: How to remove unwanted linefeeds and carriage returns?
string sRegularExpression = "([\\n\\r]+)"; //Match either of x0D or x0A one or more times.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Oct 26th, 2005, 02:29 AM
#5
Thread Starter
Frenzied Member
Re: How to remove unwanted linefeeds and carriage returns?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|