TagUI icon indicating copy to clipboard operation
TagUI copied to clipboard

tagui v6.109 - IF ELSE with contain filter as variable is not executing as intended.

Open GarneshMike opened this issue 2 years ago • 2 comments

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

GarneshMike avatar Sep 14 '22 04:09 GarneshMike

Hi @GarneshMike you can try the following:

string = "this is a test"
filter = 'test'

if string.indexOf(filter) !== -1
  echo True
else
  echo False

ruthtxh avatar Sep 14 '22 04:09 ruthtxh

Hi @ruthtxh ,

It work like a charm. Thanks.

GarneshMike avatar Sep 14 '22 06:09 GarneshMike

Closing this issue for now, feel free to reopen.

ruthtxh avatar Oct 13 '22 03:10 ruthtxh