VBScript StrComp လုပ်ဆောင်ချက်
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။
StrComp လုပ်ဆောင်ချက်သည် စာကြောင်းနှစ်ခုကို နှိုင်းယှဉ်ပြီး နှိုင်းယှဉ်မှုရလဒ်ကို ကိုယ်စားပြုသည့် တန်ဖိုးတစ်ခုကို ပြန်ပေးသည်။
StrComp လုပ်ဆောင်ချက်သည် အောက်ပါတန်ဖိုးများထဲမှ တစ်ခုကို ပြန်ပေးနိုင်ပါသည်။
- -1 ( အကယ်၍ string1 < string2 )
- 0 (အကယ်၍ string1 = string2)
- 1 ( အကယ်၍ string1 > string2 )
- 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:
|
ဥပမာ ၁
response.write(StrComp("VBScript","VBScript"))
Output:
0
ဥပမာ ၂
response.write(StrComp("VBScript","vbscript"))
Output:
-1
ဥပမာ ၃
response.write(StrComp("VBScript","vbscript",1))
Output:
0
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။