Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

[Twine 2, Harlowe] How to check a string for containing multiple keywords?

$
0
0
I would like to have the user input a phrase and have a response printed if any one of a number of certain keywords is detected in the string that the user made. I'm able to implement the "contain" operator with an (if:) or (unless:) statement just fine for only one word. However, the moment I try to add more strings I get back an error:

I can only use 'or' to join booleans, not the string "[any string i put]".►
If one of these values is a number, you may want to write a check that it 'is not 0'. Also, if one is a string, you may want to write a check that it 'is not "" '.
These strings are never 0 or empty. I write them in the format of
(if: "word" or "phrase" is in $greeting)
or
(if: $input contains "word" or "phrase")
And it always spits back that "or" error even though I am using "or".

Can anyone tell me how I might implement a check for multiple strings? Thanks.

Viewing all articles
Browse latest Browse all 1844

Trending Articles