- 1). Launch Microsoft Visual Basic Express and click the "New Project" on the "Start Page" tab. Click "Visual Basic" below "Installed Templates" and double-click "Console Application" to create a new console project.
- 2). Copy and paste the following code below "Sub Main()" to create two variables you will use to check for alphabet characters in a string:
Dim bldStr As New System.Text.StringBuilder
Dim arrayChr() As Char = "Today is the 18th." - 3). Create a "For...Loop" by typing the following code and append each alphabet character to the "bldStr" variable:
For Each chtr As Char In arrayChr
If Char.IsLetter(chtr) Then bldStr.Append(chtr)
Next - 4). Display the string using the Console window by typing the following code:
Console.Write(bldStr)
MsgBox("Done") - 5). Press "F5" to run your program and view the results.
SHARE