Discuss Scratch
- Discussion Forums
- » Suggestions
- » More string manipulation
- Tbtemplex97
- Scratcher
100+ posts
More string manipulation
Currently, string manipulation blacks are very limited but have complicated workarounds so I suggest blocks such as letters through of
- griffpatch
- Scratcher
100+ posts
More string manipulation
But it's the complicated workarounds that make us think, and isn't that what Scratch is all about? Problem solving and mind training
I completely agree with that in principle, however if you want to manipulate a megabyte of string data, having to do it character by character and the memory implications of rebuilding strings in this way is both very slow and inefficient. It could also be argued there are more important aspects of your programs that you want to spend the effort problem solving than string manipulation? - I for one would say we need more string manipulation blocks (substring and indexof)… pretty please
- technoboy10
- Scratcher
1000+ posts
More string manipulation
@griffpatch +1
I support.
I support.
trans rights are human rights
- 0bitasy0
- Scratcher
77 posts
More string manipulation
This would be great, especially with cloud data holding strings soon.
+1
+1
- griffpatch
- Scratcher
100+ posts
More string manipulation
A reported that returns the number 3 if you do this:
And a reporter that return “am” if you do this:
Find String “am” in “I am griffpatch”
And a reporter that return “am” if you do this:
Substring “I am griffpatch” from “3” to “4”
Last edited by griffpatch (June 28, 2013 12:03:23)
- curiouscrab
- Scratcher
500+ posts
More string manipulation
Interesting ideas. I know lots of Scratch Modifications include these new blocks because they weren't in Scratch, but one of the biggest problems is people make the mistake of replacing instead of adding. I know in Bingo 2.0, LS97 replaced (letter () of ) with (letters () - () of ) and I was trying to make a script and couldn't because I only needed one letter and I was putting things like (letters (1) - (1) of ) which comes up as an error. So basically, the moral of the story is be careful what you wish for and/or be careful when modifying Scratch.
- curiouscrab
- Scratcher
500+ posts
More string manipulation
I think griffpatch's version seems a little more professional/technical, which can be both good or bad.The second you have there is like the first one I have above. A reported that returns the number 3 if you do this:Find String “am” in “I am griffpatch”
And a reporter that return “am” if you do this:Substring “I am griffpatch” from “3” to “4”
- griffpatch
- Scratcher
100+ posts
More string manipulation
I think griffpatch's version seems a little more professional/technical, which can be both good or bad.The second you have there is like the first one I have above. A reported that returns the number 3 if you do this:Find String “am” in “I am griffpatch”
And a reporter that return “am” if you do this:Substring “I am griffpatch” from “3” to “4”
You are quite right, and perhaps yours is worded better for use in scratch… I wanted to just show two blocks that both add functionality that is missing from Scratch, but that work well together and in themselves are enough to do most string related tasks (except perhaps adding a ‘to uppercase’ and ‘to lowercase’?
- Discussion Forums
- » Suggestions
- » More string manipulation