It would be helpful if you said what language your are writing this in i.e. VB, C#, ect... It would also be cool if you explained where the input was comming from i.e. textbox, combobox, ect...

Here is one way to do what you want.

Code:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        
        Dim strInput As String
...