Trying to Remove new line in string

curlydog

Well-known member
Joined
Jul 5, 2010
Messages
50
Programming Experience
Beginner
Beginners Question
*****************
I'm having some trouble removing a new line from a string. I've tried regex.replace(myString, "\r\n","") and regex.replace(mySTring, environment.newline, "") but neither work. Every time I debug.Print the string it appears on two lines

The string itself is the innerText which I have parsed from an htmlAgilityPack document. Does this object use some other kind of encoding to represent a new line?

I've been trying to solve this for a couple of hours now and I'm still baffled
 
Your regex would have worked if you had Regex.Replace(s, "\n|\r", "") instead I think. The way you did it there had to be both \r (vbCr) and \n vbLf. If you use the bars its \n OR \r (or both) that are replaced.
 
Back
Top