توابع Filter VBScript
تعریف و استفاده
تابع Filter میتواند آرایهای بر اساس شماره صفر بازگرداند، که شامل زیر مجموعهای از آرایه فیلتر شده است که بر اساس شرایط خاص فیلتر شده است.
توضیحات:اگر با پارامتر value نمونایی نیابد، تابع Filter یک آرایه خالی برمیگرداند.
توضیحات:اگر پارامتر inputstrings بایو یا ناایکدار بایو، خطا رخ میدهد.
فارسی
Filter(inputstrings,value[,include[,compare]])
پارامتر | Description |
---|---|
inputstrings | زامل. ناھاودا بایو دا ساری فیلار تایمینگ دا ھایوایو. |
value | Required. The string to search for. |
include | Optional. Boolean value that specifies whether the returned substring contains Value. If Include is True, Filter will return a subset of the array that contains the substring Value. If Include is False, Filter will return a subset of the array that does not contain the substring Value. |
compare | Optional. Defines the type of string comparison to use. |
Parameter compare value:
Constant | Value | Description |
---|---|---|
vbBinaryCompare | 0 | Gudanar da tushe binary |
vbTextCompare | 1 | Gudanar da tushe da tafiyar da yadda |
Example
Example 1
dim a(5),b a(0)="Saturday" a(1)="Sunday" a(2)="Monday" a(3)="Tuesday" a(4)="Wednesday" b=Filter(a,"n") document.write(b(0)) document.write(b(1)) document.write(b(2))
Output:
Sunday Monday Wednesday
Example 2
dim a(5),b a(0)="Saturday" a(1)="Sunday" a(2)="Monday" a(3)="Tuesday" a(4)="Wednesday" b=Filter(a,"n",false) document.write(b(0)) document.write(b(1)) document.write(b(2))
Output:
Saturday Tuesday