Prawa funkcja VBScript
❮ Pełne odniesienie do VBScript
Funkcja Right zwraca określoną liczbę znaków z prawej strony ciągu.
Porada: Użyj funkcji Len, aby znaleźć liczbę znaków w ciągu.
Wskazówka: spójrz także na funkcję Left.
Składnia
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 |
Przykłady
Przykład 1
<%
txt="This is a beautiful day!"
response.write(Right(txt,10))
%>
Wynikiem powyższego kodu będzie:
tiful day!
Przykład 2
Zwróć cały ciąg:
<%
txt="This is a beautiful day!"
x=Len(txt)
response.write(Right(txt,x))
%>
Wynikiem powyższego kodu będzie:
This is a beautiful day!
❮ Pełne odniesienie do VBScript