str_enclose: Enclose a string in brackets

View source: R/utils.R

str_encloseR Documentation

Enclose a string in brackets

Description

str_enclose() encloses a string in parentheses (default) or other open/close characters. It supports adding a leading space and does not enclose NA.

Usage

str_enclose(s, open = "(", close = ")", add_space = TRUE)

Arguments

s

A string to enclose

open

The open character (default is paren)

close

The close character (default is paren)

add_space

(TRUE) Should a leading space be added?

Value

s enclosed by open and close.

Examples

## Not run: 
  str_enclose("testing",open="[",close="]")

## End(Not run)

steveneschrich/pgreportr documentation built on Jan. 13, 2025, 7:09 p.m.