VBScript 왼쪽 함수


❮ 완전한 VBScript 참조

Left 함수는 문자열의 왼쪽에서 지정된 수의 문자를 반환합니다.

팁: Len 함수를 사용하여 문자열의 문자 수를 찾습니다.

팁: Right 기능도 살펴보세요.

통사론

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

실시예 1

<%

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

%>

위 코드의 출력은 다음과 같습니다.

This is a beaut

실시예 2

전체 문자열을 반환합니다.

<%

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

%>

위 코드의 출력은 다음과 같습니다.

This is a beautiful day!

❮ 완전한 VBScript 참조