Trim 函数

来源:互联网 发布:网络研修总结作业 编辑:程序博客网 时间:2024/06/05 08:30

The Trim function removes spaces on both sides of a string.
Trim 函数可返回不带前导与后续空格 (Trim) 的字符串副本

语法

Trim(string)

 

实例 1

dim txt
txt=" This is a beautiful day! "
document.write(Trim(txt))
输出:
"This is a beautiful day!"