suchanoob suchanoob - 3 months ago 22
Vb.net 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("http://www.whocallsme.gr/el/master/lookup/19588")
source = source.Replace(vbCrLf, "")


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

Rob Rob
Answer

Try this:

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