Função direita do VBScript
❮ Referência completa do VBScript
A função Right retorna um número especificado de caracteres do lado direito de uma string.
Dica: Use a função Len para encontrar o número de caracteres em uma string.
Dica: Veja também a função Esquerda.
Sintaxe
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 |
Exemplos
Exemplo 1
<%
txt="This is a beautiful day!"
response.write(Right(txt,10))
%>
A saída do código acima será:
tiful day!
Exemplo 2
Retorna a string inteira:
<%
txt="This is a beautiful day!"
x=Len(txt)
response.write(Right(txt,x))
%>
A saída do código acima será:
This is a beautiful day!
❮ Referência completa do VBScript