Funzione destra VBScript


❮ Riferimento completo di VBScript

La funzione Right restituisce un numero specificato di caratteri dal lato destro di una stringa.

Suggerimento: utilizzare la funzione Len per trovare il numero di caratteri in una stringa.

Suggerimento: guarda anche la funzione Sinistra.

Sintassi

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

Esempi

Esempio 1

<%

txt="This is a beautiful day!"
response.write(Right(txt,10))

%>

L'output del codice sopra sarà:

tiful day!

Esempio 2

Restituisce l'intera stringa:

<%

txt="This is a beautiful day!"
x=Len(txt)
response.write(Right(txt,x))

%>

L'output del codice sopra sarà:

This is a beautiful day!

❮ Riferimento completo di VBScript