Left

Top  Previous  Next

function Left(sSource As String, iLength As Integer) As String

 

Returns a string containing a specified number of characters (iLength) from the left side of the string sSource.

 

If iLength is 0, an empty string is returned. If iLength specifies more characters than are available in sSource, the entire string is returned.

 

Parameters

 

sSource ... String expression from which the leftmost characters are returned.
iLength ... Integer expression indicating how many characters to return.

 

Example:

Dim s, s2

 

= "This is a text"

s2 = Left(s, 7)

' returns s2 = "This is"




Translate document: