Click to See Complete Forum and Search --> : Very very simple question to everyone
casparas
Jan 3rd, 2000, 09:33 PM
How to get the length of string?
for egzample i have "WholyGvakamoly"
and i need to get number 14 (the length)
Use Len(string)
It will return the length of a string.
casparas
Jan 3rd, 2000, 10:01 PM
Well i tried that before
and VB says "indentifier expected" or something like that
could anyone please write the sample code
Mark Sreeves
Jan 3rd, 2000, 10:14 PM
did you miss off a " ?
msgbox len("WholyGvakamoly")
works
as does
dim strTemp as string
stremp = "WholyGvakamoly"
msgbox len(strtemp)
------------------
Mark Sreeves
Analyst Programmer
Mark.Sreeves@Softlab.co.uk
A BMW Group Company
LG
Jan 3rd, 2000, 10:19 PM
Hi,casparas!
Put command button and Text box on your form:
Private Sub Command1_Click()
Dim YourString As String
Dim LengthOfYourString As Integer
YourString = "WholyGvakamoly"
LengthOfYourString = Len(YourString)
Text1 = LengthOfYourString
End Sub
After you click the button,you'll see in text box - 14
Good luck.
Larisa
casparas
Jan 4th, 2000, 12:01 AM
Thank you very much that's exactly what i needed
-Casparas
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.