How to I get the length of a string? For example:
VB.NET would be 5 characters long..
I knew how to do this once upon a time.
Printable View
How to I get the length of a string? For example:
VB.NET would be 5 characters long..
I knew how to do this once upon a time.
Just use the length method of the variable.
VB Code:
Dim a As String a = "hello" 'To make the integer returned a string MessageBox.Show(a.Length.ToString()) Dim b As Integer b = a.Length()
Fyi, "VB.NET" is 6 characters long. If you're variable is named say, MyString, then you can get the length with MyString.Length.
Thanks to both of you for the help!
6... Yep :D My mistake.