1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/docs/lib2x-slice.md
2020-01-28 17:51:20 +08:00

582 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 specified begin and extends to the end of the original list.

Examples

use <util/slice.scad>;

echo(slice([for(c = "helloworld") c], 0, 5)); // ECHO: ["h", "e", "l", "l", "o"]
echo(slice([for(c = "helloworld") c], 5));    // ECHO: ["w", "o", "r", "l", "d"]