# String search+select kind of function

**URL:** <https://forum.kirupa.com/t/string-search-select-kind-of-function/203195>\
**Category:** Uncategorized\
**Created:** [October 9, 2006, 12:22am UTC](https://forum.kirupa.com/t/string-search-select-kind-of-function/203195 "2006-10-09T00:22:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalexand](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kalexand](https://forum.kirupa.com/u/kalexand)\
**Post date:** [October 9, 2006, 12:22am UTC](https://forum.kirupa.com/t/string-search-select-kind-of-function/203195/1 "2006-10-09T00:22:55Z")

</div>

i’m trying to write a function but with no luck. seems my brain capacity’s limited:)  
the function will take two parameters: a term to search for, and a string to be searched. what i want the function to return is a new string containing the term (the parameter) along with a couple of words before and after it (as found in the search string). is anyone so kind as to help me with that?
