在获取字符串时,用trim清理下前后的空格,对程序开发人员是个好习惯。
使用方法:
password=trim(request("password"))
复制代码 代码如下:
dim txttxt=" This is a beautiful day! "
document.write(Trim(txt))
输出:"This is a beautiful day!"
ASP LTrim 函数
LTrim 函数可返回不带前导空格 (LTrim)的字符串
复制代码 代码如下:
dim txttxt=" This is a beautiful day! "
document.write(LTrim(txt))
输出:"This is a beautiful day! "
asp rtrim
RTrim 属性可返回不带后续空格 (RTrim)的字符串
复制代码 代码如下:
dim txttxt=" This is a beautiful day! "
document.write(RTrim(txt))
输出:" This is a beautiful day!"