How to find a period in a text string
JTT4056
Member, PRO Posts: 10
Hi, I am trying to find the end of a sentence in a text string using the textFind behavior.
How do I specify the pattern in order to find a period? I tried '.', but it doesn't work. I also tried '.' and that didn't work either.
Any ideas?
Thanks!
Janine
Comments
oops. the second thing I tried was backslash-period. That got lost in the html posting.
You need to use double quotes. This is true for any text expressions, not just for punctuation.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You'll need to use "%." in the expression editor for the period.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
See now, I learn something new every day.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang, I had to go look it up!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks! Can you tell me where you looked it up? @jamie_c
I found it at the link below:
http://stackoverflow.com/questions/15258313/finding-with-string-find
Since Gamesalad is based on Lua I did a search for "lua period escape code".
I had been researching the topic for my book so at least I knew what to look for.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Perfect! Thanks!