Is there a easy way to create a subarray, to slice an array?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Armslice

It seems there is no method on array to create a slice of the array? Is this correct?

My work around is to create a new array and then iterate over the indecies of the original array and copy them one at a time into the new array. Is this the best way??

And out of curiosity why is this not included in the Array methods? I would really prefer that the sytax from Python was availble as it is with string. Arr[start:finish] - and if thats too complex to implement, why not have Array.slice(start: int, end: int)??

just for your information, there’s an old issue for it.
Array slicing for GDScript · Issue #4715 · godotengine/godot · GitHub

volzhs | 2019-05-10 01:09