Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript Left function


May 13, 2021 VBScript


Table of contents


VBScript Left function

The VBScript Left function returns a specified number of characters to the far left of the string.


VBScript Left function Complete VBScript reference manual

The Left function returns a specified number of characters from the left side of the string.

Tip: Use the Len function to determine the number of characters in the string.

Tip: See Right function.

Grammar

Left(string,length)

parameter describe
string Required.From the string of the character's character.
length Required.How many characters need to return to the regulations.If set to 0, return an empty string ("").Returns the entire string if set to a length greater than or equal to the string.

Instance 1

<script type="text/vbscript">

txt="This is a beautiful day!"
document.write(Left(txt,15))

</script>

The above example output results:

This is a beaut

Try it out . . .

Instance 2

Returns the entire string:

<script type="text/vbscript">

txt="This is a beautiful day!"
x=Len(txt)
document.write(Left(txt,x))

</script>

The above example output results:

This is a beautiful day!

Try it out . . .

VBScript Left function Complete VBScript reference manual