From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Work with strings

Work with strings - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Work with strings

- [Instructor] The string is one of the most common types use in programming Visual Basic applications. It is implemented as a .NET type, and easily available in your VB code. It's full of interesting properties and methods. We could spend an hour or more exploring its features. Since time is limited, I've pre written the demo code. Let's take a quick look at some of the interesting aspects. We'll start by looking at how to create a string variable. One of the easiest ways to do it is shown here on line seven. You declare it with the Dim keyword, you give it an identifier, and then you assign a string. String literals in VB use a double quote on either end of the text. This is implicitly typing it to a string. If you want to be explicit, use the as string. Next we're going to look at a constructor. Constructors are methods that are part of a class that is called when you instantiate a new object. So in VB use the new…

Contents