VBScriptの正しい関数
❮完全なVBScriptリファレンス
Right関数は、文字列の右側から指定された文字数を返します。
ヒント: Len関数を使用して、文字列内の文字数を検索します。
ヒント: Left関数も見てください。
構文
Right(string,length)
Parameter | Description |
---|---|
string | Required. The string to return characters from |
length | Required. Specifies how many characters to return. If set to 0, an empty string ("") is returned. If set to greater than or equal to the length of the string, the entire string is returned |
例
例1
<%
txt="This is a beautiful day!"
response.write(Right(txt,10))
%>
上記のコードの出力は次のようになります。
tiful day!
例2
文字列全体を返します。
<%
txt="This is a beautiful day!"
x=Len(txt)
response.write(Right(txt,x))
%>
上記のコードの出力は次のようになります。
This is a beautiful day!
❮完全なVBScriptリファレンス