VBScript InStrRev လုပ်ဆောင်ချက်
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။
InStrRev လုပ်ဆောင်ချက်သည် နောက်တစ်ခုအတွင်းရှိ စာကြောင်းတစ်ခု၏ ပထမဆုံးဖြစ်ပေါ်မှု အနေအထားကို ပြန်ပေးသည်။ ရှာဖွေမှုသည် string ၏အဆုံးမှစတင်သော်လည်း၊ ပြန်လာသောအနေအထားသည် string ၏အစမှရေတွက်သည်။
InStrRev လုပ်ဆောင်ချက်သည် အောက်ပါတန်ဖိုးများကို ပြန်ပေးနိုင်သည်။
- string1 သည် "" ဖြစ်ပါက - InStrRev သည် 0 သို့ပြန်သွားသည်။
- string1 သည် Null ဖြစ်ပါက - InStrRev သည် Null ဖြစ်သွားသည်။
- string2 သည် "" ဖြစ်ပါက - InStrRev သည် စတင်သည်။
- string2 သည် Null ဖြစ်ပါက - InStrRev သည် Null ဖြစ်သွားသည်။
- string2 ကို ရှာမတွေ့ပါက - InStrRev သည် 0 ကို ပြန်ပေးသည်။
- string2 ကို string1 တွင်တွေ့ရှိပါက - InStrRev သည် ကိုက်ညီသည့်နေရာကို ပြန်ပေးသည်။
- start > Len(string1) - InStrRev သည် 0 ပြန်တက်လာလျှင်
အကြံပြုချက်- InStr လုပ်ဆောင်ချက်ကိုလည်း ကြည့်ရှုပါ ။
အထားအသို
InStrRev(string1,string2[,start[,compare]])
Parameter | Description |
---|---|
string1 | Required. The string to be searched |
string2 | Required. The string expression to search for |
start | Optional. Specifies the starting position for each search. The search begins at the last character position by default (-1) |
compare | Optional. Specifies the string comparison to use.
Default is 0 Can have one of the following values:
|
ဥပမာများ
ဥပမာ ၁
<%
txt="This is a beautiful day!"
response.write(InStrRev(txt,"beautiful"))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
11
ဥပမာ ၂
ကွဲပြားခြားနားသော စတင်သည့်နေရာများကို အသုံးပြု၍ စာလုံး "i" ကို ရှာခြင်း-
<%
txt="This is a beautiful day!"
response.write(InStrRev(txt,"i",-1) & "<br />")
response.write(InStrRev(txt,"i",7) & "<br />")
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
16
6
ဥပမာ ၃
စာသား၊ နှင့် ဒွိနှိုင်းဖြင့် စာလုံး "T" ကို ရှာခြင်း-
<%
txt="This is a beautiful day!"
response.write(InStrRev(txt,"T",-1,1) & "<br />")
response.write(InStrRev(txt,"T",-1,0) & "<br />")
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
15
1
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။