Search String for Characters

Simply speaking first:

How do you search a string for specific characters.

Say I have a string of information that is “Josh is trying to find information.”

With an input text box I type the characters “info”.

If that snippet of characters is found in the given string I want to return a true or turn a light on on the stage.

That is not what my intentions are… but that hopefully communicates my need. Here is what I’m doing.

I have a 2d array that is housing a set of movies. The movieClip thumbnail list of movies is created dynamically at runtime based on this 2d array. Say I have 25 movies one day or and 13 the next… the menu re-creates itself every time. What I need to do now is create the menu based on a user’s search results. Say a user enters the prase, comedy. I need to search my 2d array for all references of comedy then return the query.

I can do the above with a direct search result. But say someone types in elepha intending to have all elephants returned. This is sort of like a Visual Basic inString function – I want to return all the matches that have the characters the user enters… not only exact matches.

So far I’m setting up a for next loop to step through the array. I can find exact matches but need to find substrings also.

Thanks,

Joshua