Friday, August 13, 2010

Visual Basic String Function : Right

Purpose : The Right function return a portion of a string , starting at the last character and working to the left , for the length specified.

Syntax :
Right ( strExpression , ingLength )
RightB ( strExpression , ingLength )

strExpression : Specifies the string for which you want the ingLength rightmost characters
ingLength : Specifies the number of characters of the returned substring.

Dim strHello as String , strDolly as String
strDolly = "Hello, Dolly!"
strHello = Right ( strDolly , 6)

In this code the rightmost six characters from strHello to the variable strDolly , giving it a value of "Dolly!".

No comments:

Post a Comment