VBScript Right 函式
❮ VBScript 參考大全
Right 函式從字串的右側返回指定數量的字元。
提示:使用 Len 函式查詢字串中的字元數。
提示:還可以檢視 Left 函式。
語法
Right(string,length)
引數 | 描述 |
---|---|
string | 必需。要從中返回字元的字串 |
length | 必需。指定要返回的字元數。如果設定為 0,則返回空字串 ("")。如果設定為大於或等於字串長度,則返回整個字串 |
示例
示例 2
返回整個字串
<%
txt="This is a beautiful day!"
x=Len(txt)
response.write(Right(txt,x))
%>
上面程式碼的輸出將是
This is a beautiful day!
顯示示例 »
❮ VBScript 參考大全