VBScript StrComp फ़ंक्शन

वर्णन और उपयोग

StrComp फ़ंक्शन दो तालिकाओं को तुलना कर सकता है और तुलना परिणाम को वापस देता है。

StrComp फ़ंक्शन नीचे के वैल्यू को वापस दे सकता है:

  • -1 (如果 string1 < string2)
  • 0 (如果 string1 = string2)
  • -1 (if string1 < string2)
  • 0 (if string1 = string2)

1 (if string1 > string2)

Null (if string1 or string2 is Null)
सिंटैक्स StrComp(string1,string2[,compare])
parameter string1
वर्णन string1
string2

आवश्यक।शब्द अभिव्यक्ति。

compare

  • वैकल्पिक।किसी भी इस्तेमाल के लिए स्ट्रिंग की तुलना को निर्धारित करें।मूलभूत 0 है।Optional. Specifies the string comparison to use. Default is 0
  • स्वीकार्य मान्यताएँ:

0 = vbBinaryCompare - द्विपद तुलना करें

1 = vbTextCompare - लिख्ती तुलना करें

उदाहरण

आउटपुट:

0

उदाहरण 2

document.write(StrComp("VBScript","vbscript"))

आउटपुट:

-1

उदाहरण 3

document.write(StrComp("VBScript","vbscript",1))

आउटपुट:

0