Change case block

A feature I’d like to see in Hopscotch is:

A block to make every letter in a string either uppercase or lowercase. This would work best if matches was case sensitive, too.

Here are some examples of Hopscotch code that could be improved if we had this:

Checking if some string equals some other string but not caring about the case.

This is a rare example of a problem that cannot be solved with In string, replace something with something, at least not very easily. It can be done with what blocks we have now (like in my caesar cipher a project), but it is slow compared to if it had its own block.

14 Likes

Matches is now case insensitive now if I am not mistaken

8 Likes

that’s a good suggestion:)

2 Likes

Yes, this would make that unnecessary and we can go back to a case sensitive matches block.

4 Likes

They should just allow us to convert from an ASCII character to an ASCII value. It would allow us to do a lot.

6 Likes

Yeah I agree with that.

4 Likes

This is a really good idea.


YES. That’s what I was tryna do this morning lol and it was not fun. It needs its own block or something lol.

6 Likes

I agree

I think this should convert to the correct number (check ,) for anything greater than 32 and not 127, but it is either slow or can only be done one at a time.

5 Likes

It would also be good if you could check if a strong was all uppercase or lowercase.

3 Likes

That would work with regular expressions if they were case sensitive.

^[ABCDEFGHIJKLMNOPQRSTUVWXYZ]$

3 Likes

I wish there was that…

I just realized I spelled “string” as “strong”. Oops.

3 Likes

With a case sensitive matches block, you could!

Wouldn’t ^[A-Z\W0-9]*$ work better?

2 Likes

This is super helpful, especially when you make search bars it applies to both the uppercase and lowercase string. (Sorry my unclear language)

I edited the title to make it clearer (not just lowercase), hope that’s ok

I like this

1 Like

really nice idea

Yeah I just typed the first thing that came to mind

1 Like

Awesome, like

string.lower()

in python