VBScript linkerfunksie _


❮ Voltooi VBScript-verwysing

Die Left-funksie gee 'n gespesifiseerde aantal karakters van die linkerkant van 'n string terug.

Wenk: Gebruik die Len-funksie om die aantal karakters in 'n string te vind.

Wenk: Kyk ook na die Regte-funksie.

Sintaksis

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

Voorbeelde

Voorbeeld 1

<%

txt="This is a beautiful day!"
response.write(Left(txt,15))

%>

Die afvoer van die kode hierbo sal wees:

This is a beaut

Voorbeeld 2

Gee die hele string terug:

<%

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

%>

Die afvoer van die kode hierbo sal wees:

This is a beautiful day!

❮ Voltooi VBScript-verwysing