Skip to Content

String manipulation blocks for Scratch

« How do I...?
No replies
Phil Curnow
Member
I have implemented a set of string manipulation blocks for Scratch. The blocks are Left, Right, Mid, ToUpperCase and ToLowerCase. A brief description of these: Left(string, n) - Allows you to return the left most n characters of a string, e.g. Left("Scratch", 3) will return Scr. Right(string, n) - Allows you to return the right most n characters of a string, e.g. Right("Scratch",3) will return tch. Mid(string, start, n) - Allows you to return a specific part of a string, e.g. Mid("Scratch Programming", 9, 7) will return Program from the string. ToUpperCase(string) - Allows you to convert a string to upper case. e.g. ToUpperCase("scratch") will return SCRATCH and ToLowerCase("SCRATCH") will return scratch. The link to the project is http://scratch.mit.edu/projects/12402145/ I have also put together a detailed blog post explaining fully what the blocks do and how to use them. The link for this is http://philcurnow.wordpress.com/2013/09/22/scratch-custom-string-blocks/