How do i get all the specific characters in a text and replace it? (Solved)

Hello, i have no experience with Javascript and DID try to use replace() in my own code to replace specific text, but it didn’t work.
I can get the specific characters but don’t know how to replace them. I am just basicly trying to get all zeros in a text and replace it with spaces.
I also believe there are no events for this and i don’t really understand the regular functions extention.

Thank you in advance.

Here’s a thread about Reg Ex.

https://forum.gdevelop.io/t/how-do-i-replace-specific-values-in-string/61352/4?u=keith_1357

The common flags are i and g
i is used to ignore cases. Like Apple and apple
g is used to match every occurrence.

You wouldn’t need the i flag since numbers don’t have cases. The g flag would match all occurrences.

Using this variable

Gives this
Screenshot_20241030_224006_Chrome

1 Like

Ah, thank you so much! That actually makes sense.

1 Like