Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Function UnblackList(ByVal code As String) As String
- If code.Trim = String.Empty Then
- Return String.Empty
- Else
- Dim path As String = Application.StartupPath & "\data\words.black"
- If Not File.Exists(path) Then
- Return code
- Else
- 'Load words
- Dim words() As String = File.ReadAllLines(path)
- 'check the words one by one and replace theme by adding <font></font> in the middle
- For i As Integer = 0 To words.Length - 1
- Dim position As Integer = 0
- Do
- position = code.IndexOf(words(i), position)
- If position <> -1 Then
- 'Insert <font></font> after the first character
- code.Insert(position + 1, "<font></font>")
- End If
- Loop While position <> -1
- Next
- Return code
- End If
- End If
- End Function
Add Comment
Please, Sign In to add comment