VBScript အလယ်အလတ် လုပ်ဆောင်ချက်
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။
Mid လုပ်ဆောင်ချက်သည် string တစ်ခုမှ သတ်မှတ်ထားသော စာလုံးအရေအတွက်ကို ပြန်ပေးသည်။
အကြံပြုချက်- စာကြောင်းတစ်ခုရှိ စာလုံးအရေအတွက်ကို ဆုံးဖြတ်ရန် Len လုပ်ဆောင်ချက်ကို အသုံးပြုပါ။
အထားအသို
Mid(string,start[,length])
Parameter | Description |
---|---|
string | Required. The string expression from which characters are returned |
start | Required. Specifies the starting position. If set to greater than the number of characters in string, it returns an empty string ("") |
length | Optional. The number of characters to return |
ဥပမာများ
ဥပမာ ၁
အနေအထား 1 မှစတင်၍ စာလုံး 1 လုံးကို ပြန်ပို့ပါ-
<%
txt="This is a beautiful day!"
response.write(Mid(txt,1,1))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
T
ဥပမာ ၂
အနေအထား 1 မှစတင်၍ စာလုံး 15 လုံးပြန်ပေးပါ။
<%
txt="This is a beautiful day!"
response.write(Mid(txt,1,15))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
This is a beaut
ဥပမာ ၃
အနေအထား 1 မှစတင်၍ စာလုံးအားလုံးကို ပြန်ပို့ပါ-
<%
txt="This is a beautiful day!"
response.write(Mid(txt,1))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
This is a beautiful day!
ဥပမာ ၄
အနေအထား 12 မှစတင်၍ စာလုံးအားလုံးကို ပြန်ပို့ပါ-
<%
txt="This is a beautiful day!"
response.write(Mid(txt,12))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
eautiful day!
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။