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
Hey guys! Can someone help me to find the line of a character or number in text?
I use 2 Text Plugins, 1 Text Box and 1 Button. So, we have:
This is a test.
[code:184pmp0f]TextBox -> I write "Today!"
Button -> Click[/code:184pmp0f]
To understand more, the lines of text as i think are:
"This is a test." is 0
"Today!" is 1
"10" is 2
"Hello C2!!!" is 3
"100" is 4
What i need to use? A Regex Search? Array? A simple method? Can someone help me? Thanks!
Develop games in your browser. Powerful, performant & highly capable.
repeat tockencount(text1, newline) times
system compare: tockenat(text1, loopindex, newline) = textbox.text
--- set text2 to loopindex
--- stop loop
Thank you!!! ; -)