In string, replace something with something

I second that

4 Likes

I third that.

4 Likes

Here are more examples of things we could do more easily with this:
Faster version of my saving art pad
Messages with parameters, though not with the broadcast block.
Escaping regular expressions so that you don’t get problems like in my Caesar cipher project when you put a ? or a ( etc
Level editors
Shape art editors/treating shape art as a single object

And much more, I look forward to seeing this added to the app.

5 Likes

Yes, why hasn’t this been added yet? We’ve been waiting more than three months.

2 Likes
  • I would use this

0 voters

3 Likes

Interesting idea. Can you do this now with the characters between block? :thinking:

3 Likes

yes, but not efficiently

1 Like

nice tag #still-waiting

2 Likes

Bruh I won’t continue EGCode until this is implemented
I sold 13 stuffed animals actually, that last one was made of plastic

1 Like

Yes, @Petrichor, I do like the edit bumps. This really does need to exist .

3 Likes

Uh #replaceblock2020 ?
Why is that a tag lol
But this is easily a no-brainer (you don’t even need a brain to know that this is a great idea to add this (yes I know that is not biologically possible but well it’s just something peeps say lol))

2 Likes

Not that tag ig lol

3 Likes

Another bump
I need this for like 3 projects lol

3 Likes

:left_speech_bubble: You cannot make yourself feel something you do not feel, but you can make yourself do right in spite of your feelings. — Pearl Buck

4 Likes
  • If you’re using the same replace as JS, this will only take a couple lines of code to implement. Also, I would definitely use this in my projects. It would be really useful in scenarios such as the one given in the first post of adding leading zeroes to all "14"s in a sentence like “I sold 14 stuffed animals”. It would also expand the capabilities of string interpreters and much more if we also had a “match” block (returns matching string) in addition to the matches (returns boolean).

0 voters

2 Likes

Yeah lol

stringsmth.replace('a', 'b') //I think
1 Like

I’ve used the match function on Microsoft Excel and found it to be very useful. It would be great if they added something like that to Hopscotch.

3 Likes
2 Likes

Definitely sire @tht

2 Likes

BUMP
There could be an issue with this. Replacing 14 with 014 in 2014 will result in 20014. A solution could be adding spaces surrounding both Slots 1 and 2.
v Solution v
Replace ( 14 ) with ( 014 ) in (2014)
will return 2014 instead of 20014.

4 Likes