Replace the Nth occurence of a text

Get help using Construct 2

Post » Wed Oct 23, 2013 7:23 pm

The goal I have is simple, but I can't figure how to do it in C2, I am sure it is easy though..

I know the replace(src, find, rep) does exists, but it replace every ocurence of find with rep. Or I would like to be able to check how many time find is present, and to replace only one chosen of the occurence of find with rep

exemple:

"01101112"

I want to remplace the second 1 with A, and only this one:

"01A01112"

Is there an easy way to do this?
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Return to How do I....?

Who is online

Users browsing this forum: nahima and 13 guests