TagUI
TagUI copied to clipboard
tagui v6.109 - IF ELSE with contain filter as variable is not executing as intended.
Hi Sifus,
My attempt to search a KEYWORD from a STRING using the IF ELSE function always return False if the KEYWORD is a variable (EXAMPLE 1). But if I hardcode the KEYWORD, it works (EXAMPLE 2)
Anything that i missed.
// Tagui Block Starts - EXAMPLE 1
string = "this is a test" filter = 'test'
echo String = string
echo Filter = filter
if string contain "filter
"
echo True
else
echo False
// Tagui Block Ends - EXAMPLE1
// Tagui Block Starts - EXAMPLE2 string = "this is a test" filter = 'test'
echo String = string
echo Filter = filter
if string contain "test1" echo True else echo False
// Tagui Block Ends - EXAMPLE2
Hi @GarneshMike you can try the following:
string = "this is a test"
filter = 'test'
if string.indexOf(filter) !== -1
echo True
else
echo False
Hi @ruthtxh ,
It work like a charm. Thanks.
Closing this issue for now, feel free to reopen.