How do I search a string for keywords?

Get help using Construct 2

Post » Mon Apr 13, 2015 9:26 pm

For example, if I had a variable that stored the string "I laugh in the face of danger! No, cheeseburgers. I laugh in the face of cheeseburgers." and I wanted to be able to check to see whether the string stored in that variable contained the word "apples," how would I do that?
B
6
S
2
Posts: 6
Reputation: 681

Post » Mon Apr 13, 2015 9:29 pm

Wait a minute: I may have solved my own problem. Look in the Text section of this link (remove space bc I don't have the reputation to post actual links): https:// www. scirra. com/manual/126/system-expressions
B
6
S
2
Posts: 6
Reputation: 681

Post » Mon Apr 13, 2015 11:12 pm

System compare two values...

Code: Select all
RegexMatchCount(Variable,"\bapples\b","g")>0
add action....
Image
B
63
S
23
G
7
Posts: 1,480
Reputation: 10,796


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Mayfly and 6 guests