Universal slicer

I've made a universal (works on strings and lists) slicer

slice

These are examples of what parameters return what result

List Slicing
slice script pic
slice script pic (1)
slice script pic (2)
slice script pic (3)

Empty end slot == length of list. Empty start == 1
slice script pic (4)

Both start and end must be between 1 to length of list
slice script pic (5)

If end > start, reported value is reversed
slice script pic (12)

String Slicing
slice script pic (6)
slice script pic (7)
slice script pic (8)
slice script pic (9)

See list examples above for explanation of these

slice script pic (10)
slice script pic (11)
slice script pic (13)

I have deliberately coloured in the word slice using the list colour to show that the block works with both strings and lists

ProjectName=slice

Love it! Great idea.

Updated to not require JavaScript

7 posts were split to a new topic: Policing the forum

:+1::+1::+1::+1::+1:

Behaviour changed:

Processed values should be within the possible indices of the sliced item otherwise it will report an empty string or list

Start and end types changed to any type (so I can tell difference between empty slot and a zero value) so the current reporter will be seen as a different block than the original