How do I change middle part of text

Get help using Construct 2

Post » Thu Apr 23, 2015 10:23 am

Lets say i have string "0:0:0:0:0". How to replace 3rd zero with 1 ?


edit: ...when some object is clicked
B
7
S
1
Posts: 18
Reputation: 363

Post » Thu Apr 23, 2015 2:59 pm

bump!
B
7
S
1
Posts: 18
Reputation: 363

Post » Thu Apr 23, 2015 3:25 pm

mid(text, index, count)
Return the count characters starting from index in text.

Though you have to know after how many characters your third zero starts...
If you want to do inplace changes to a token-filled string, you might be better off with using an array instead, really.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Apr 24, 2015 1:32 pm

mindfaQ wrote:mid(text, index, count)
Return the count characters starting from index in text.

Though you have to know after how many characters your third zero starts...
If you want to do inplace changes to a token-filled string, you might be better off with using an array instead, really.

Thanks man, just discovered arrays xD
B
7
S
1
Posts: 18
Reputation: 363


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests