Learn R Programming

FastUtils (version 0.2.1)

enclose: Enclose String with Specified Characters

Description

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

Usage

enclose(x, left, right)

Value

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

Arguments

x

A character string to enclose.

left

A character string to prepend.

right

A character string to append.

Examples

Run this code
enclose("text", "[", "]") # returns "[text]"

Run the code above in your browser using DataLab