Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to create fast split function
- TheForceStudio
-
100+ posts
How to create fast split function
Hello there! I have a question: how to create fast split function?
Okay, firstly - my split function:

Is there a way to somehow improve this function, make it more compact?
The point is that the function splits the string into list items, and that there is a certain character which separates them
Okay, firstly - my split function:

Is there a way to somehow improve this function, make it more compact?
The point is that the function splits the string into list items, and that there is a certain character which separates them
- TheForceStudio
-
100+ posts
How to create fast split function
(i know that i can use “run without screen reflesh”, im already use it, but i search more compact function)
- Oumuamua
-
1000+ posts
How to create fast split function
Hello there! I have a question: how to create fast split function?
Okay, firstly - my split function:
Is there a way to somehow improve this function, make it more compact?
The point is that the function splits the string into list items, and that there is a certain character which separates them
Hi, only a bit, but yes

Greetings.
- StrangeMagic32
-
1000+ posts
How to create fast split function
That cuts out the first half of the text Hi, only a bit, but yes
-snip-
Greetings.
Depends, do you want it more compact height wise, or total block count? Is there a way to somehow improve this function, make it more compact?
Last edited by StrangeMagic32 (April 7, 2020 23:47:35)
- Oumuamua
-
1000+ posts
How to create fast split function
That cuts out the first half of the text
Yep. i tested it, but there was a space as first letter

Greetings.
- joshpinto6
-
45 posts
How to create fast split function
EDIT: Just put this in a custom block set to ‘run without screen refresh’.
Yes, there is a way to do this you need four variables:
And one list:
This script will go through the “ValuetoSplit” And seperate it into parts which it will then add to the “Output” list. Hope this works!
Happy Scratching!
Yes, there is a way to do this you need four variables:
And one list:
This script will go through the “ValuetoSplit” And seperate it into parts which it will then add to the “Output” list. Hope this works!
Happy Scratching!
Last edited by joshpinto6 (April 8, 2020 12:33:53)
- TheForceStudio
-
100+ posts
How to create fast split function
I want it to be smaller in height, I think it would be prettier Depends, do you want it more compact height wise, or total block count?
I think my code is better, because zero#k will be equal to the length of the text, and not 1 more. For me it is much more correct!
Thank you, but I think the code has not become more compact, but rather - it has more variables (now there are 2 instead of 1), and it is even higher in height. But thanks for the way! EDIT: Just put this in a custom block set to ‘run without screen refresh’.
Yes, there is a way to do this you need four variables:
And one list:
* code *
This script will go through the “ValuetoSplit” And seperate it into parts which it will then add to the “Output” list. Hope this works!
Happy Scratching!
- StrangeMagic32
-
1000+ posts
How to create fast split function
This is more compact (height wise), but it does have it's own problems once you try doing different lengths of strings
https://scratch.mit.edu/projects/383629453/
https://scratch.mit.edu/projects/383629453/
Last edited by StrangeMagic32 (April 8, 2020 14:35:44)
- TheForceStudio
-
100+ posts
How to create fast split function
I fixed this error This is more compact (height wise), but it does have it's own problems once you try doing different lengths of strings
https://scratch.mit.edu/projects/383629453/
Thank you all for your help, I close the topic (in a few hours, maybe someone will offer something else)!
I realized that this is the most optimal code.
- Discussion Forums
- » Help with Scripts
-
» How to create fast split function