VBScript StrComp 함수
❮ 완전한 VBScript 참조
StrComp 함수는 두 문자열을 비교하고 비교 결과를 나타내는 값을 반환합니다.
StrComp 함수는 다음 값 중 하나를 반환할 수 있습니다.
- -1(문자열1 < 문자열2인 경우)
- 0(문자열1 = 문자열2인 경우)
- 1(문자열1 > 문자열2인 경우)
- Null(string1 또는 string2가 Null인 경우)
통사론
StrComp(string1,string2[,compare])
Parameter | Description |
---|---|
string1 | Required. A string expression |
string2 | Required. A string expression |
compare | Optional. Specifies the string comparison to use.
Default is 0 Can have one of the following values:
|
실시예 1
response.write(StrComp("VBScript","VBScript"))
Output:
0
실시예 2
response.write(StrComp("VBScript","vbscript"))
Output:
-1
실시예 3
response.write(StrComp("VBScript","vbscript",1))
Output:
0
❮ 완전한 VBScript 참조