- 1). Open Visual Basic. Create a new project by clicking "File," "New Project." Select "Console application."
- 2). Paste the following code within the application:
Dim s = "This is a " & vbNewLine & " multiline string."
MsgBox(s)
Dim t = s.Split(vbNewLine)
MsgBox(t.Length)
This defines a string with two lines, shows it to the user, splits it wherever there is a line break and shows you the total line count. - 3). Click "Run" to test your application.
previous post
next post