How to remove new line characters from a string in VB.NET

1 Answer

0 votes
Imports System.Text.RegularExpressions

Module Module1

    Sub Main()

        Dim s As String = "VB.NET" & vbLf & "C#" & vbLf & "Java" & vbLf & "Python" & vbLf

        s = Regex.Replace(s, "\n", " ")

        Console.WriteLine(s)

    End Sub

End Module

' run:
' 
' VB.NET C# Java Python

 



answered Jul 26, 2018 by avibootz
...