Skip to contents

Wrapper around glue_collapse() using sep = ", " and last = " and " as default arguments.

Usage

enumerate(x, sep = ", ", last = " and ")

Arguments

x

A character vector.

sep

Separator used to separate the terms.

last

Separator used to separate the last two items if x has at least 2 items.

Value

A character string with the same class as x.

Examples

aut <- Plume$new(encyclopedists)
aut$get_author_list() |> enumerate()
#> Denis Diderot, Jean-Jacques Rousseau, François-Marie Arouet and Jean Le Rond d'Alembert