VBScript Left Function
The Left function returns a specified number of characters from the left side of a string.
Tip: Use the Len function to determine the number of characters in a string.
Tip: See also the Right function.
Syntax
| Parameter | Description |
|---|---|
| string | Required. The string from which to return characters. |
| length | Required. Specifies how many characters to return. If set to 0, it returns an empty string (""). If set to greater than or equal to the length of the string, it returns the entire string. |
Example
Example 1
The output of the above example:
Example 2
Returns the entire string:
The output of the above example: