Strings

Lesson

Strings

There are 4 blocks within operations that we can use to interact with and change a string, this could be used to change what is being said by a sprite. We can also put variables inside of these white rounded rectangles which will insert data inside.

This first block will combine the two words and output them as a string. In this case, it would produce “apple banana”.

This block will print out the letter in the second block which is in the position of the first block. So in this case, the letter “a” will be printed.

This block will print how many letters/numbers are in the white space. In this case, it would print 5.

This last block is used in conditionals and will output either true or false depending on what’s inside. It will output true because the letter “a” is in apple.

Click on this link to view some example code. Try to change the code around so it does something else!

https://scratch.mit.edu/projects/353477600/editor/

@

Not recently active