CONTAINS block for text strings

Technically every string does include an empty string. Of course it also is like this is scratch, and javascript (as well as python), so I feel like that's perfectly fine.

You can make it even smaller with modern blocks

I’m pretty sure the smallest possible way to make this is 3 blocks but I might be wrong

I just want to mention, one great thing about that method now compared to in previous snap versions is that the split by block now follows the case sensitivity setting. In previous versions, the split by block was case sensitive, making it not as great of a solution. In snap 9.0, there was a case sensitivity setting added, which then allowed the split by block to be case insensitive.

Just a little trivia for anyone who might have been wondering (and also, why can't the text contains block in the strings, multi-line input library be changed to use the split by block instead?).

That's a good idea, thanks.

How did you get the not equals to predicate?

  1. Drag the equals block (untitled script pic 371) from the Operators palette into the scripting area;
  2. Right-click on the block; a pop-up window appears;
  3. Select relabel; a series of alternative blocks appears;
  4. Select the not equals block (untitled script pic 372).

Done!

you can just drag it into the editor, no?

That was before smart script pics were a thing (seriously, that was back in 2020).

Oh woah, I didn't even bother to check the age of this post. How come so many old posts are resurfacing?
(and yeah, I know, I was here before smart scripts were a thing too)

necroposting...

True

also, since the tutorials page doesn't get many new posts, it's really easy to accidentally post on a really old topic.