Skip to content
Snippets Groups Projects
Commit b3567946 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

range manual page

Rev: doc/operators/range:1.1
parent f5c90a72
Branches
Tags
No related merge requests found
NAME
range - cut a slice of an array or string
SYNTAX
a [ b .. c ]
or
a [ .. c ]
or
a [ b .. ]
DESCRIPTION
This operator cuts out a piece of an array or string. If a is an array
a[b..c] will return an array containing a[b], a[b+1], a[b+2] to a[c].
Given a string about the same thing will happen, except the the result
will be a string of course. If b is omitted, everything from the
beginning up to and including c will be included. If c is omitted
the result will include everything from (and including) b to the end.
EXAMPLES
"foobar"[0..3] returns "foo"
"foobar"[4..6] returns "bar"
({1,2,3})[..2] returns ({1,2})
({1,2,3})[2..] returns ({2,3})
({1,2,3})[..] returns ({1,2,3})
KEYWORDS
operators
SEE ALSO
index
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment