mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-16 13:50:05 +01:00
570 B
570 B
slice
Returns a list selected from begin
to end
, or to the end
of the list (end
not included).
Since: 2.0
Parameters
lt
: The original list.begin
: The beginning index, inclusive.end
: The ending index, exclusive. If it's omitted, the list begins with the character at the specifiedbegin
and extends to the end of the original list.
Examples
use <util/slice.scad>
assert(slice([for(c = "helloworld") c], 0, 5) == ["h", "e", "l", "l", "o"]);
assert(slice([for(c = "helloworld") c], 5) == ["w", "o", "r", "l", "d"]);