当前位置: 首页 > 网络学院 > 客户端脚本教程 > VBScript > VBScript Left 函数
The Left function returns a specified number of characters from the left side of a string.
Left 函数可返回指定数目的从字符串的左边算起的字符
Tip: Use the Len function to find the number of characters in a string.
提示:可使用 Len 函数确定 string 参数中的字符数目。
Tip: Also look at the Right function.
提示:还可以参考Right 函数
Left(string,length) |
参数 | 描述 |
---|---|
string | Required. The string to return characters from 必选项。字符串表达式,其最左边的字符被返回。 |
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 必选项。数值表达式,指明要返回的字符数目。如果是 0,返回零长度字符串 ("");如果大于或等于 string 参数中的字符总数,则返回整个字符串。 |
dim txt 输出: This is a b |
dim txt 输出: This is a beautiful day! |
dim txt,x 输出: This is a beautiful day! |