' Count Blanks Example ' Count the number of blanks in a input string. Imports System.Console Public Module Module1 Public Sub Main() Dim s As String Dim blankCount As Integer = 0 Write("Enter the input string: ") s = ReadLine() For i As Integer = 0 To s.Length - 1 If s.Substring(i, 1) = " " Then blankCount += 1 End If Next WriteLine("The number of blanks is " & _ blankCount & ".") ReadLine() End Sub End Module