Funkce VBScript vlevo
❮ Kompletní VBScript Reference
Funkce Left vrací zadaný počet znaků z levé strany řetězce.
Tip: Pomocí funkce Len zjistíte počet znaků v řetězci.
Tip: Podívejte se také na funkci Right.
Syntax
Left(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(Left(txt,15))
%>
Výstupem výše uvedeného kódu bude:
This is a beaut
Příklad 2
Vraťte celý řetězec:
<%
txt="This is a beautiful day!"
x=Len(txt)
response.write(Left(txt,x))
%>
Výstupem výše uvedeného kódu bude:
This is a beautiful day!
❮ Kompletní VBScript Reference