Originally Posted By: Georges_K
Would you mind explaining it to me?


Sure.

It's actually a very simple process but reducing it to a one-liner makes the code very dense and hard to read, which is the main reason that I'd recommend going for a simple loop. Making your own code difficult to maintain is never a good idea \:\)

The code is creating a new line of KiXtart code as a string and then EXECUTE-ing it, returning a TRUE/FALSE value via the EXIT built-in.

We split $sStringsToSearch into an array, then JOIN it back together using KiXtart InStr() code as the glue instead of the default space character. Finally we tag a little bit of code to the front "Exit Instr(" and the final closing parenthesis ")" on the end and we have an executable bit of code.

It all becomes clear if you add a line to print the generated code:
 Code:
"Exit InStr('"+$s+"','"+Join(Split($sStringsToSearch,","),"') AND InStr('"+$s+"','")+"')"+@CRLF


Gives you:
 Quote:
Exit InStr('abcd','ab') AND InStr('abcd','bc') AND InStr('abcd','bcd') AND InStr('abcd','d')


In this example the generated code is about the same number of characters as the code that creates it so there is not much gain, but if you had many more strings in $sStringsToSearch or if $sStringsToSearch was coming from a variable source then the code would be worthy.