RmChr Function:

The RmChr function is used to remove unwanted characters from a string. There are two required arguments, input and remove. The input argument is the string to clean. The disallowed argument is a string of disallowed characters in any order. RmChr returns the original string with any disallowed characters removed.

Syntax:
string = RmChr(Input, Disallowed)
Example Usage:
<%
Dim Input, Disallowed

 ' String to clean
Input =	"sjsvnw)68&Y469$T_W$(*T+}D|3567808SDK49SO" & _
		"DJ0570570Gosdnp SNDFG_S(*GH-S570570GN*4 jwt jtj+W$T )"

 ' Allow spaces, underscores and any integer or letter of the alphabet.
 ' Remove anything else...
Disallowed = "[]+=)(*&^%$#@!|\/?><,{}:;.-~`'" & chr(34) & vbCrLf & vbTab
Response.Write RmChr(Input, Disallowed) & "<BR>"

 ' remove spaces, tabs, linefeed carriagereturns...
Disallowed = " " & vbTab & vbCrLf
Response.Write RmChr(Input, Disallowed) & "<BR>"

 ' remove numbers...
Disallowed = "0123456789"
Response.Write RmChr(Input, Disallowed) & "<BR>"

 ' remove lower case letters...
Disallowed = lcase("abcdefghijklmnopqrstuvwxyz")
Response.Write RmChr(Input, Disallowed) & "<BR>"

 ' remove upper case letters...
Disallowed = ucase("abcdefghijklmnopqrstuvwxyz")
Response.Write RmChr(Input, Disallowed) & "<BR>"
%>
ASP Source Code:
<%
Private Function RmChr(byVal string, byVal remove)
	Dim i, j, tmp, strOutput
	strOutput = ""
	for j = 1 to len(string)
		tmp = Mid(string, j, 1)
		for i = 1 to len(remove)
			tmp = replace( tmp, Mid(remove, i, 1), "")
			if len(tmp) = 0 then exit for
		next
		strOutput = strOutput & tmp
	next
	RmChr = strOutput
End Function
%>