Maybe a block under "operators" that does the opposite of
<join [hello] [world]>seperated by a character or a few that splits two values apart and gives one, like this:
(split [2&4] [before v] [&])
Offline
Another way would be to make a substring function:
SUBSTR("NARUTO",2,3)
would give "ARU", by starting from the 2nd character ("A"), and (while including that) count 3 letters- A, R, and U.
This would be a lot faster than seperating the word into a list.
Offline
I think a more understanding way to do this would be to make the
<letter (1) of [1]>turn into
<letter (1) through (3) of [12345]>It would have what you want, but in a way that is easier to read.
Offline
I want a split function that takes a string and a character as input. The result would be a list. The string would be split by the specified character into list entries.
For example, you could easily split a sentence into a word list by specifying a space character.
Offline
TorbyFork234 wrote:
I think a more understanding way to do this would be to make the
<letter (1) of [1]>turn into<letter (1) through (3) of [12345]>It would have what you want, but in a way that is easier to read.
I'm not sure about this, as most other programming languages have the substring do this:
From the string [NARUTO], start from [2] and get [3] characters.
Also, since Scratch is supposed to help beginner programmers move on to a more complex language, it should be as close to other languages as possible.
At least that's what I think.
Offline
BoltBait wrote:
I want a split function that takes a string and a character as input. The result would be a list. The string would be split by the specified character into list entries.
For example, you could easily split a sentence into a word list by specifying a space character.
I agree. I use this a lot in Processing and it's helpful.
Offline