summaryrefslogtreecommitdiffstats
path: root/doc/lremove.n
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-10 07:46:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-10 07:46:32 (GMT)
commit7b90ffbb489e5b0b09f23a6296f69f070127fd57 (patch)
treeb4b8b874d4101f811de99438daa6d037daa506f1 /doc/lremove.n
parentf9eb1833d2785265d8dc52992750ef10d9cc1c19 (diff)
parentb1139d3d2099aad8ad1981deaa0f689e1b4c322a (diff)
downloadtcl-7b90ffbb489e5b0b09f23a6296f69f070127fd57.zip
tcl-7b90ffbb489e5b0b09f23a6296f69f070127fd57.tar.gz
tcl-7b90ffbb489e5b0b09f23a6296f69f070127fd57.tar.bz2
merge 8.7
Diffstat (limited to 'doc/lremove.n')
-rw-r--r--doc/lremove.n55
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/lremove.n b/doc/lremove.n
new file mode 100644
index 0000000..b947863
--- /dev/null
+++ b/doc/lremove.n
@@ -0,0 +1,55 @@
+'\"
+'\" Copyright (c) 2019 Donal K. Fellows.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.TH lremove n 8.7 Tcl "Tcl Built-In Commands"
+.so man.macros
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+lremove \- Remove elements from a list by index
+.SH SYNOPSIS
+\fBlremove \fIlist\fR ?\fIindex ...\fR?
+.BE
+.SH DESCRIPTION
+.PP
+\fBlremove\fR returns a new list formed by simultaneously removing zero or
+more elements of \fIlist\fR at each of the indices given by an arbirary number
+of \fIindex\fR arguments. The indices may be in any order and may be repeated;
+the element at index will only be removed once. The index values are
+interpreted the same as index values for the command \fBstring index\fR,
+supporting simple index arithmetic and indices relative to the end of the
+list. 0 refers to the first element of the list, and \fBend\fR refers to the
+last element of the list.
+.SH EXAMPLES
+.PP
+Removing the third element of a list:
+.PP
+.CS
+% \fBlremove\fR {a b c d e} 2
+a b d e
+.CE
+.PP
+Removing two elements from a list:
+.PP
+.CS
+% \fBlremove\fR {a b c d e} end-1 1
+a c e
+.CE
+.PP
+Removing the same element indicated in two different ways:
+.PP
+.CS
+% \fBlremove\fR {a b c d e} 2 end-2
+a b d e
+.CE
+.SH "SEE ALSO"
+list(n), lrange(n), lsearch(n), lsearch(n)
+.SH KEYWORDS
+element, list, remove
+.\" Local variables:
+.\" mode: nroff
+.\" fill-column: 78
+.\" End: