Quote:
Originally Posted by lim888
Any code for keyword detection use in rude word detection?
|
First of all... ignore ADAM Web Design - you should be asking questions, its the best way to learn.
My code is in .NET & will filter the word 'hello' with the replacement 'h****'. Its also assuming that you have a label on the page called 'Label1'.
- if you have any questions then just ask, do look at the code though as its not hard to impliment or expand.
codebehind:
Code:
Public Function swearFilter(ByVal swears As String) As String
swears = Replace(swears, "hello", "h****")
swearFilter = swears
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Label1.text = swearFilter("hello")
EndIf
End Sub
Last edited by boomers; 10-25-2006 at 04:55 PM..
|