Re: How best to check if string contains any of a list of substrings?

2018-11-01 Thread Keith Clarke via use-livecode
Thanks Alex - I thought the single-pass ‘is among’ with wildcards was a long-shot, so I’ll concentrate on debugging the list iteration using the ‘contains’ check. :-) The strings & sub-strings are simple - I have a large list of URLs that need to be processed differently (or ignored), based on

Re: How best to check if string contains any of a list of substrings?

2018-11-01 Thread Alex Tweedly via use-livecode
Hi Keith, I think the simplest method would be (almost) your second attempt below. However, you were using "*est*" - i.e. with the '*'s before and after the phrase, which is what you would need for 'filter' but not for 'contains'. So it should work with just put “my test phrase” into myTest

How best to check if string contains any of a list of substrings?

2018-11-01 Thread Keith Clarke via use-livecode
Folks, What is the most efficient way to test whether a variable containing a string such as “my test phrase” contains one of several variable substrings, such as “est” OR “phr” OR... ? So far I’ve tried (without luck) approaches that simplify into... put “my test phrase” into myTestPhrase put