Technology Programming

How to Find the Number of Lines in a String for Visual Basic

    • 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.

Related posts "Technology : Programming"

Differences Between Byte Array Vs. String

Programming

Web Design Company UK/

Programming

Develop A Quality Plan With These Self Help Tips

Programming

TMediaPlayer: What track am I on?

Programming

How You Can Prove Your Expertise

Programming

Furniture Advice And Tips And Also Hardwearing. Property Searching Wonderful

Programming

Web Design Fort Lauderdale Business

Programming

Hire Web Designer and Diminish Development Expenditure

Programming

Web Masters.

Programming

Leave a Comment