13-06-2006, 04:07 PM
Well, I changed it a bit, and I thought I could share
What I did is removing the Useless Byval Index as long and exept of remplacing whole insult by ***, you can change to whatever you want
Code:
Public Function CheckMessage(Msg As String)
Dim SwearSplit() As String
Dim SwearReplaceSplit() As String
Dim Swears As String
Dim SwearReplace As String
Dim i As Integer
Swears = "ass,fuck,shit,bitch,"
SwearReplace = "***,f**k,s**t, b****,"
SwearSplit = Split(Swears, ",")
SwearReplaceSplit = Split(SwearReplace, ",")
For i = 0 To UBound(SwearSplit)
If InStr(LCase(Msg$), LCase(SwearSplit(i))) Then
Msg$ = Replace$(LCase(Msg$), LCase(SwearSplit(i)), LCase(SwearReplaceSplit(i)), 1)
End If
Next i
End Function
What I did is removing the Useless Byval Index as long and exept of remplacing whole insult by ***, you can change to whatever you want