Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
b3567946
Commit
b3567946
authored
29 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
range manual page
Rev: doc/operators/range:1.1
parent
f5c90a72
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/operators/range
+30
-0
30 additions, 0 deletions
doc/operators/range
with
30 additions
and
0 deletions
doc/operators/range
0 → 100644
+
30
−
0
View file @
b3567946
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment