Pravá funkce VBScript


❮ Kompletní VBScript Reference

Funkce Right vrací zadaný počet znaků z pravé strany řetězce.

Tip: Pomocí funkce Len zjistíte počet znaků v řetězci.

Tip: Podívejte se také na funkci Vlevo.

Syntax

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

Příklady

Příklad 1

<%

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

%>

Výstupem výše uvedeného kódu bude:

tiful day!

Příklad 2

Vraťte celý řetězec:

<%

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

%>

Výstupem výše uvedeného kódu bude:

This is a beautiful day!

❮ Kompletní VBScript Reference