mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 03:50:27 +02:00
add doc
This commit is contained in:
18
docs/lib2-slice.md
Normal file
18
docs/lib2-slice.md
Normal 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"]
|
Reference in New Issue
Block a user