Wednesday, August 11, 2010

Visual Basic String Function : Left

Purpose : The Left functions return a portion of a variant or a string, starting at the first character , of the length specified.

Syntax :
Left (strExpression , IngLength )
LeftB ( strExpression , IngLength )

strExpression : Specifies the string from which you want to return then IngLenght leftmost characters.
IngLength : Specifies the number of characters of the returned substring.

Dim strDolly as String , strHello as String
strDolly = "Hello, Dolly!"
strHello = Left ( strHello , 5)

the five leftmost characters from strDolly to the variable strHello , giving it a value of "Hello".

No comments:

Post a Comment