Hi all,
I am trying to upgrade my bad words filter, which is this:
I am trying to follow this tutorial (found from google'ing: bad word filter asp.net)...
http://www.codefixer.com/codesnippets/replacebadwords.asp
Coincidentally, my code is outputting their example 1. I want to get to example 2. I have tried and tried to merge the code, but can't get it. Please help.
Thanks in advance,
a8le
I am trying to upgrade my bad words filter, which is this:
VB.NET:
Page_Load...
Dim xmlDocPath As String = MapPath("BadWordsList.xml")
Dim xmlReader As XmlTextReader = New XmlTextReader(xmlDocPath)
While (xmlReader.Read())
If xmlReader.NodeType = XmlNodeType.Text Then
alWordList.Add(xmlReader.Value)
Trace.Write("Added: " & xmlReader.Value)
End If
End While
xmlReader.Close()
Public Function CheckString(ByVal InputString As String) As String
Dim r As Regex
Dim element As String
Dim output As String
Trace.Write("Checking " & InputString)
For Each element In alWordList
r = New Regex("\b" & element)
Trace.Write("Checking: " & element)
InputString = r.Replace(InputString, "")
Next
Trace.Write("Returning " & InputString)
Return InputString
End Function
I am trying to follow this tutorial (found from google'ing: bad word filter asp.net)...
http://www.codefixer.com/codesnippets/replacebadwords.asp
Coincidentally, my code is outputting their example 1. I want to get to example 2. I have tried and tried to merge the code, but can't get it. Please help.
Thanks in advance,
a8le