Правильная функция 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