Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Maybe I did not searched with the proper words, but I cannot find a way to check if a string contains some text.
For example I would like an event like this one:
variable1 = "sometext"
if variable1 contains "text" return true.
Is this possible ?
From the manual:
Find the first index within src that text occurs, else returns -1.
so system compare two values : find(variable1, "text") is not -1
if the variable contains the text this condition will be true...
http://s000.tinyupload.com/index.php?fi ... 9968479480
Thank you littleStin tha'ts perfect !
I was looking in regex, but this was in fact much simplier.
Korbaach, that's interesting. This is much more complex, but it reveals some interesting tricks, thank you.
Develop games in your browser. Powerful, performant & highly capable.
Can u upload that again please?
see the second comment in this post.
Use "System->Compare two values"
first value: Find(text1, text2)
comparison: Not equal to
second value: -1
find works in the latest version of C2?
I did several tests and it seems that everything simply returns -1, whether or not the correct word exists
It should work, you are doing something wrong.
Probably. How can I use it the right way.
I have never used this feature.
System compare two values find("Abcdef", "bcd") not equal -1
Thanks, I got it resolved.