vb.net replace line breaks

IWeb

Newcomer
Joined
Sep 12, 2003
Messages
11
Hello,

How can I replace line breaks in vb.net from a string?
I just tried to replace the substring "\n" but this won't work.

thank you,
 
Actually CRLF is 13 and 10, not vice versa. Plus Chr() is part of the VB compatability library, so if you want to avoid it you could do something like this:
Visual Basic:
theString = theString.Replace(System.Text.Encoding.ASCII.GetString(New Byte() {13, 10}), "")
A little longer, but I personally try to write code that stays the same (except syntax of course) between VB.NET and C# - Chr() will not work in C#.
 
Back
Top