You don't loop it, that is the point. If you need to know where in the string /x is, cache the return of contain and use that. Contain returns the index of where the second argument is. Check out the wiki. then you'd take that index, add 2, and that is the start of w/e you're looking for.
Show the whole function so i know more of what you're trying to do.
__________________
What an elegant solution to a problem that doesn't need solving....