trim the search string