suchanoob suchanoob - 5 months ago 31 Question

VB.NET: Convert multiline string into single line

I'm grabbing the HTML source code of a webpage and try to convert it to a single-line string but I can't.

This is my code:

Dim source As String = client.DownloadString("")
source = source.Replace(vbCrLf, "")

I also tried using Environment.NewLine and vbNewLine instead of vbCrLf but the result remains the same.

Rob Rob

Try this:

source = source.Replace(vbLf, "").Replace(vbCr, "")