Skip to contents

This function encloses a string with specified characters on the left and the right.

Usage

enclose(x, left, right)

Arguments

x

A character string to enclose.

left

A character string to prepend.

right

A character string to append.

Value

A new character string with x enclosed by left and right.

Examples

enclose("text", "[", "]") # returns "[text]"
#> [1] "[text]"