Split List In Two

Hello,

Looking for some help.
I have a textbox that contains this text.

Input_Text = "Alpha|1,2,3,4,5"

I want to split the text in two lists to read the following.

List_1 = "Alpha"
List_2 = "1,2,3,4,5"

List_1 will be the first value before the "|" symbol.
List_2 will be the remaining values after the "|". Separated by ",".

blocks (1)

Thank you

image

1 Like

and if you need second list to be another list

then you need to split it further using ','

1 Like

If my list looks like this: 1, e, 4, f, 3, g, 5, h, 4, 2.7, y, 0, 3, 1, d (or any other sequence) how do I split it at the fifth element?

I tried using the 'all but first element' block five times in a row, but it feels inefficient. Is there a better way? That is because I only wanted the rest of the list.

There is a list block available for this:

image

image
(there is a hack in there to get the last item of the list...shouldn't work but seems to :wink: )

2 Likes

I tried that one, but not that inexistant index2 :wink:
Never thougrh about a possible out of range index2

Thanks!!!!