The Length() function in String Class returned the number of characters occurred in a String.
System.String.Length() As Integer
Returns:
Integer : The number of characters in the specified String
For ex:
"This is a Test".Length() returns 14.
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim str As String str = "This is a Test" MsgBox(str.Length()) End Sub End Class