Left

Top  Previous  Next

Sub Left($s As String, $length As Integer) As String

 

Returns a string containing a specified number of characters ($length) from the left side of the string $s.

 

If $length is 0, an empty string is returned. If $length specifies more characters than are available in $s, the entire string is returned.

 

Parameters

 

$s ... String expression from which the leftmost characters are returned.
$length ... Integer expression indicating how many characters to return.

 

Example:

Dim $s, $s2

 

$s = "This is a text"

$s2 = Left($s, 7)

' returns $s2 = "This is"