欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ASP trim,ltrim,rtrim 去前后空格 函數(shù)

 更新時(shí)間:2010年05月31日 17:14:32   作者:  
Trim 函數(shù)可返回不帶前導(dǎo)與后續(xù)空格 (Trim) 的字符串.
這個(gè)主要應(yīng)用于,獲取用戶輸入的時(shí)候,防止用戶不小心,多輸入了一個(gè)空格,導(dǎo)致驗(yàn)證無(wú)法通過(guò),多用于用戶名跟密碼的,好多情況下,大家復(fù)制的winrar的解壓密碼,都會(huì)默認(rèn)多輸入一個(gè)空格,所以這個(gè)是需要注意的。

在獲取字符串時(shí),用trim清理下前后的空格,對(duì)程序開(kāi)發(fā)人員是個(gè)好習(xí)慣。
使用方法:
password=trim(request("password"))

復(fù)制代碼 代碼如下:

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

輸出:"This is a beautiful day!"

ASP LTrim 函數(shù)
LTrim 函數(shù)可返回不帶前導(dǎo)空格 (LTrim)的字符串
復(fù)制代碼 代碼如下:

dim txttxt=" This is a beautiful day! "
document.write(LTrim(txt))

輸出:"This is a beautiful day! "
asp rtrim
RTrim 屬性可返回不帶后續(xù)空格 (RTrim)的字符串

復(fù)制代碼 代碼如下:

dim txttxt=" This is a beautiful day! "
document.write(RTrim(txt))

輸出:" This is a beautiful day!"

相關(guān)文章

最新評(píng)論