小白教程
所有教程
关于
Search
172.70.131.49
172.70.131.49
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Func left”的源代码
本页内容
上一节:
Func_lcase
下一节:
Func_len
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:Left}}[[Category:vbscript ref functions|82]] = VBScript Left 函数 = [[vbscript ref functions|完整的 VBScript 参考手册]] Left 函数从字符串的左侧返回指定数量的字符。 '''提示:'''请使用 Len 函数来确定字符串中的字符数量。 '''提示:'''请参阅 Right 函数。 === 语法 === <pre> Left(string,length) </pre> {| class="table table-striped table-hover" ! 参数 ! 描述 |- | string | 必需。从其中返回字符的字符串。 |- | length | 必需。规定需返回多少字符。如果设置为 0,则返回空字符串("")。如果设置为大于或等于字符串的长度,则返回整个字符串。 |} == 实例 1 == <sample title="" desc="" lang="vb" hererun="1"> <script type="text/vbscript"> txt="This is a beautiful day!" document.write(Left(txt,15)) </script> </sample> 以上实例输出结果: <sample title="" desc="" lang="vb" hererun="1"> This is a beaut </sample> == 实例 2 == 返回整个字符串: <sample title="" desc="" lang="vb" hererun="1"> <script type="text/vbscript"> txt="This is a beautiful day!" x=Len(txt) document.write(Left(txt,x)) </script> </sample> 以上实例输出结果: <sample title="" desc="" lang="vb" hererun="1"> This is a beautiful day! </sample> [[vbscript ref functions|完整的 VBScript 参考手册]]
返回至“
Func left
”。
上一节:
Func_lcase
下一节:
Func_len