# Using split & switch default

**URL:** <https://forum.kirupa.com/t/using-split-switch-default/255488>\
**Category:** Uncategorized\
**Created:** [March 23, 2008, 5:03pm UTC](https://forum.kirupa.com/t/using-split-switch-default/255488 "2008-03-23T17:03:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danhodkinson](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@danhodkinson](https://forum.kirupa.com/u/danhodkinson)\
**Post date:** [March 23, 2008, 5:03pm UTC](https://forum.kirupa.com/t/using-split-switch-default/255488/1 "2008-03-23T17:03:20Z")

</div>

search = textBox.text.toLowerCase(); //converts whatever text to lower case  
var searchWords:Array = search.split(" ");  
for(var m:int = 0; m \< searchWords.length; m++){  
pointerAction(searchWords[m]);

using this code it splits whatever words i am searching for into individual items, however if i search for apple tree and it matches with apple but not tree it still defaults one of the items, is there a way to default only if none of the search terms are met
