وظيفة VBScript الصحيحة
❮ استكمال مرجع VBScript
ترجع الدالة Right عددًا محددًا من الأحرف من الجانب الأيمن من السلسلة.
تلميح: استخدم الدالة Len للعثور على عدد الأحرف في سلسلة.
نصيحة: انظر أيضًا إلى الوظيفة اليسرى.
بناء الجملة
Right(string,length)
Parameter | Description |
---|---|
string | Required. The string to return characters from |
length | Required. Specifies how many characters to return. If set to 0, an empty string ("") is returned. If set to greater than or equal to the length of the string, the entire string is returned |
أمثلة
مثال 1
<%
txt="This is a beautiful day!"
response.write(Right(txt,10))
%>
ناتج الكود أعلاه سيكون:
tiful day!
مثال 2
أعد السلسلة بأكملها:
<%
txt="This is a beautiful day!"
x=Len(txt)
response.write(Right(txt,x))
%>
ناتج الكود أعلاه سيكون:
This is a beautiful day!
❮ استكمال مرجع VBScript