Replace characters in text: with RegexReplace?

Get help using Construct 2

Post » Tue Nov 29, 2016 11:21 am

Hello.
I have a sentence "Hello World!".
I would like to replace the characters in position 7 to 10 (that is orld) in my sentence by "ild".
We would get "Hello Wild!".
Anyone know how?
Thank you.
B
6
S
1
Posts: 58
Reputation: 520

Post » Tue Nov 29, 2016 11:39 am

Done this using replace, not regex
Code: Select all
https://drive.google.com/file/d/0B2ztlkoVxR-FN2VVOEs4SG8yNTA/view?usp=sharing


using RegexReplace the command is RegexReplace(Input.Text,"orld","","ild")
B
13
S
3
G
2
Posts: 38
Reputation: 1,428

Post » Tue Nov 29, 2016 11:46 am

Thank you but this is not what I'm looking for if I replace the phrase "Hello World, this is the world" I get "Hello Wild, this is the wild" but i want "Hello Wild, this is the world".
That's why I want the start and end positions or start and the number of characters selected.
B
6
S
1
Posts: 58
Reputation: 520

Post » Tue Nov 29, 2016 12:02 pm

Message: WhosWho can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Not sure exactly what you mean, I can only suggest you read up on text expressions here https://www.scirra.com/manual/126/system-expressions
B
13
S
3
G
2
Posts: 38
Reputation: 1,428


Return to How do I....?

Who is online

Users browsing this forum: aquadijoib and 31 guests