lrepeat(n) Tcl Built-In Commands lrepeat(n)

```

```

# [NAME](#NAME)

lrepeat - Build a list by repeating elements

# [SYNOPSIS](#SYNOPSIS)

**lrepeat count** ?*element ...*?

```

```

# [DESCRIPTION](#DESCRIPTION)

The **lrepeat** command creates a list of size *count * number of* *elements* by repeating *count* times the sequence of elements *element ...*. *count* must be a non-negative integer, *element* can be any Tcl value.

Note that **lrepeat 1 element ...** is identical to **list element ...**.

# [EXAMPLES](#EXAMPLES)

```
lrepeat 3 a


      → a a a
lrepeat 3 [lrepeat 3 0]


      → {0 0 0} {0 0 0} {0 0 0}
lrepeat 3 a b c


      → a b c a b c a b c
lrepeat 3 [lrepeat 2 a] b c


      → {a a} b c {a a} b c {a a} b c
```

# [SEE ALSO](#SEE_ALSO)

[list(n)](/man/os/tcl/list.n), [lappend(n)](/man/os/tcl/lappend.n), [lassign(n)](/man/os/tcl/lassign.n), [ledit(n)](/man/os/tcl/ledit.n), [lindex(n)](/man/os/tcl/lindex.n), [linsert(n)](/man/os/tcl/linsert.n), [llength(n)](/man/os/tcl/llength.n), [lmap(n)](/man/os/tcl/lmap.n), [lpop(n)](/man/os/tcl/lpop.n), [lrange(n)](/man/os/tcl/lrange.n), [lremove(n)](/man/os/tcl/lremove.n), [lreplace(n)](/man/os/tcl/lreplace.n), [lreverse(n)](/man/os/tcl/lreverse.n), [lsearch(n)](/man/os/tcl/lsearch.n), [lseq(n)](/man/os/tcl/lseq.n), [lset(n)](/man/os/tcl/lset.n), [lsort(n)](/man/os/tcl/lsort.n)

# [KEYWORDS](#KEYWORDS)

element, index, list

8.5 Tcl

---

Document: lrepeat(n) from tcl 9.1.0-r0 (Chainguard OS)
Source: https://downloads.sourceforge.net/project/tcl/Tcl/9.1.0/tcl9.1.0-src.tar.gz
