Func Left
# VBScript Left Function
* * Complete VBScript Reference Manual](#)
* * *
The Left function returns a specified number of characters from the left side of a string.
**Note:** Use the Len function to determine the number of characters in a string.
**Note:** See the Right function.
### Syntax
Left(string,length)
| Parameter | Description |
| :--- | :--- |
| string | Required. The string from which to return characters. |
| length | Required. Specifies how many characters to return. If set to 0, an empty string ("") is returned. If set to greater than or equal to the length of the string, the entire string is returned. |
## Examples
## Example 1
txt="This is a beautiful day!"
document.write(Left(txt,15))
The above example outputs:
This is a beaut
[Try it Β»](#)
## Example 2
Return the entire string:
txt="This is a beautiful day!"
x=Len(txt)
document.write(Left(txt,x))
The above example outputs:
This is a beautiful day!
[Try it Β»](#)
* * Complete VBScript Reference Manual](#)
YouTip