Tips for working with text

Is Empty

The is empty block can be used to check whether or not a string, or piece of text, contains and characters.

This block returns true if there are no characters in the string and returns false if there is one or more characters in a string.

isEmpty


Example 1

In this example we want to make sure that the user has typed something into Text_Input1. There are a couple of ways to do this.

These blocks do nothing if Text_Input1 is empty and only greet the user if they have typed in the text input.

These blocks also do nothing if Text_Input1 is empty and only greet the user if they have typed in the text input.

Finally, these blocks only do something if the text input is not empty. Note the dark green not block, which can be found in with the logic blocks.

Personally, this would be my preferred way of doing this, but it’s entirely up to you which option you go for.

2 Likes