Home  |  Latest News  |  Contribute  |  F.A.Q.  |  Account  |  Scripts | About
Search ASPNut:
 
ASP Reference
Server Variables
ASP Glossary
Related Sites

Free Components

HTML Reference
Web Colors
Entities
CSS Level 1
Encode/Decode
Glossary

Our Sponsors
ASP Nuke CMS
Free Auctions
PHP 5 Script
Funktastic Blog
ULost Directory
Team Task

 

 

 

 

 

 

 

 

 

 

 

 

Filter

The Filter function will eliminate elements of an array that match or fail to match a search string. This allows you to remove forbidden words from text or only allow certain words to be entered.

Dim aArray
Dim sText

sText ="Remove those dirty words"
aArray = Split(sText)
aArray = Filter(aArray, "dirty")
sText = Join(aArray)
Response.Write "Filtered Text: " & sText


The third optional argument is a boolean value that indicates whether the search text should include words in the array or exclude words in the array. True indicates that only words that contain the search text should be returned. False means that only words that DO NOT contain the search text should be returned. If not specified, this argument defaults to True.

Dim aArray
Dim sText

sText ="Remove those dirty words"
aArray = Split(sText)
aArray = Filter(aArray, "dirty", False)
sText = Join(aArray)
Response.Write "Filtered Text: " & sText


An optional fourth argument specifies what type of string comparison should be done in order to filter out words. The default is to do a text comparison. Possible values for this argument are shown below.

ASP Variable Value Meaning
vbBinaryCompare Comparison is done on the binary values (ASCII codes) for the strings. This is also known as a case-sensitive comparison.
vbTextCompare Comparison is done on the text values for the strings. This is also known as a case-insensitive comparison.

Orvado Technologies

ASP Nuke CMS
Free Open Source
Content Manager
HomeFix Boards
Home Remodeling
Message Boards

Contact Us | Contribute | About | Site Map



"With time and patience the mulberry leaf becomes a silk gown." - Chinese Proverb

©2007 Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.