Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

VBScript Left Function

VBScript Left Function


VBScript reference manual Complete VBScript Reference Manual


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

Left(string,length)

Parameters Description
string Required. The string from which to return the characters.
length Required. Specifies how many characters to return. If set to 0, an empty string ("") is returned. If set to a value greater than or equal to the length of the string, the entire string is returned.

Example

Example 1

The example above produces the following output:

This is a beaut

Try it »

Example 2

Return the entire string:

The example above produces the following output:

This is a beautiful day!

Try it »


VBScript reference manual Complete VBScript Reference Manual