web tools rank checker

domain .cn
.net .cn .com.cn
你正在阅览 :: 简体中文:: 学习 ASP SQL VB HTML code

学习 .ASP SQL HTML XML CSS JAVA Perl code study
English Chinese_Traditional Chinese_Simplified

你正在阅览 :: 简体中文 Chinese_Simplified

学习.主题:
首页
ASP
CSS
Ecommerce
HTML
InternetProtocol
JAVA
Microsoft
Robots
SearchEngine
SQL
SQLserver
VBscript
. Array
»Filter
»Split
»UBound
. Functions
. Prevent_hacker
XML

SiteMap

3w....学习.教学 > VBSCRIPT > array » filter

3w learning

array >
filter

Title:

Filter(Input Strings,value[,include[,compare]])


过滤出所含某特定元素并组成数组
Description:

Filter(Input Strings,value[,include[,compare]]) Input Strings : The main strings Value : to be searched value Include : [ True ::( Default ) the array contains value ] [ False :: the array that does not contain value ] compare :optional Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values comparison same as Split vbBinaryCompare : 0 : Perform a binary comparison vbTextCompare : 1 : Perform a textual comparison


Example Code:

a memo report weather and date in one data cell or a text file weather= "1/1/2006w:sun,1/2/2006w:rain,1/3/2006w:storm,1/4/2006w:...." <% dim weather,dayArray,queryDay queryDay="8/6/2006" weather=request("weather") dayArray=Split(weather,",") ' if the end of weather string is ( , ) then UBound(dayArray)-1 for I=0 to UBound(dayArray)-1 ' -1 is for ( , ) ending ' way 1 ---- filter to find queryDay TrueDayArray=Filter(dayArray,queryDay) if TrueDayArray(0)<>empty then document.write(replace(TrueDayArray(0),"w:"," weather is ")) end if ' way 2 ---- instr to find queryDay if instr(dayArray(I),queryDay)>0 then response.write replace(dayArray(I),"w:"," weather is ")&"<br>" response.write replace(dayArray(I),queryDay&"w:","") end if next %>


Filter 常配合 Split, UBound, Array, instr, 
replace 更加方便呼叫出所要的资料
Example Result:

Example : 8/6/2006 weather is sun sun



..
...
...

[ 8/28/2008 ]

www learning school add more scripts and tips memo
You are at >>3WS.EZER.COM >> 3WS.EZER.COM/VBSCRIPT/ARRAY/FILTER.ASP>>VBSCRIPT
Helpful link:: SEO web tools :: Live PR | SERP checker
back to top Ezer code adding :: Questions ;email