Net-informations.com
SiteMap  | About    

How to VB.NET String.Length()



The Length() function in String Class returned the number of characters occurred in a String.

Returns:

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

When you execute this source code you will get 17 in the messagebox.






net-informations.com (C) 2019    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.