Wednesday, August 11, 2010

Visual Basic String Function : Len

Purpose : The Len function return the storage length of a variable. They are most commonly used to find the length of a string.

Syntax :
Len ( variable-name )

variable-name : The name of Visual Basic variable for which you want to determine the storage length.

Dim strHello as String
Dim ingStrLen as Long
strHello = "Hello"
ingStrLen = Len( strHello )

Because the string "Hello" contains five characters , this places the value 5 into the variable ingStrLen.

No comments:

Post a Comment