How do I get number from text?

Get help using Construct 2

Post » Sat Apr 01, 2017 9:48 am

I have a text variable containig numbers. For example (3,9) or (12, 10). If I use text expression left(text, count) it returns the first charecter, and doesn't help to return the number containing two charecters.
What is the best solution to return numbers from the text in the example?
B
20
S
4
Posts: 51
Reputation: 1,104

Post » Sat Apr 01, 2017 9:53 am

You use the token expressions, where the seperator is ",".

So tokenat(text,index,",") and wrap it in int() to convert it from string bacl to value.
B
43
S
22
G
20
Posts: 735
Reputation: 11,977

Post » Sat Apr 01, 2017 11:21 am

Ethan wrote:You use the token expressions, where the seperator is ",".

So tokenat(text,index,",") and wrap it in int() to convert it from string bacl to value.

Thanks, it works!!!
B
20
S
4
Posts: 51
Reputation: 1,104


Return to How do I....?

Who is online

Users browsing this forum: MaujDeveloper, mrkaio, user5487, Zav and 2 guests