Start New Discussion within our Software Development Community

Here is the goal. I have a document that I want to search through word by word based on an array of keywords.


Dim keywords() = {"each", "it", "and", "I"}
Dim i As Integer
        For Each key As String In keywords
            Do Until i = Procedure.LastIndexOf(key)
                Search = Procedure.IndexOf(key)
                i = Procedure.IndexOf(key, i + 1)
                Select Case key
                Case "each"
                Case "it"
                Case "I"
                Case "I"
                Case Else
            End Select

From this point I want to select a case statement based on the current keyword and its position in a string. I've figured out to find each occurance of the key, but I want to be able to search for all keys at the same time in order of their occurance.

Any help is good help.

This article has been dead for over six months. Start a new discussion instead.