1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 03:50:27 +02:00
This commit is contained in:
Justin Lin
2019-06-29 10:01:46 +08:00
parent ce0daaf6bc
commit bec487baba

18
docs/lib2-slice.md Normal file
View File

@@ -0,0 +1,18 @@
# 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 substring begins with the character at the specified `begin` and extends to the end of the original string.
## Examples
include <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"]