VB6 : Left Function

Posted by Fluffy | 5:00 AM | , | 0 comments »

Using Left Function in VB6/Classic


VB6 Left function is a string handling function whereby a front section of a string can be splitted at specific points.

For Example, we have a string "Spaceship" stored in a variable myStr and we will use Left function to split it from the left side.


'--- Variable Declarations
Dim myStr As String
Dim Output as String

myStr = "Spaceship" '--- Store the word Spaceship into myStr
Output = Left(myStr,5) '---Retrieve the front 5 letters
Msgbox(Output) '--- Display a messagebox



The output from the message above will be "Space"


See also Left Function in VB.NET
See also Mid Function in VB.NET
See also Right Function in VB.NET

See also Mid Function in VB6/Classic
See also Right Function in VB6/Classic

0 comments