# Search String for Characters

**URL:** <https://forum.kirupa.com/t/search-string-for-characters/54900>\
**Category:** flash\
**Created:** [June 18, 2004, 4:52pm UTC](https://forum.kirupa.com/t/search-string-for-characters/54900 "2004-06-18T16:52:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lomelino](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lomelino](https://forum.kirupa.com/u/lomelino)\
**Post date:** [June 18, 2004, 4:52pm UTC](https://forum.kirupa.com/t/search-string-for-characters/54900/1 "2004-06-18T16:52:58Z")

</div>

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
