Learn R Programming

stringstatic (version 0.1.2)

str_pad: Duplicate and concatenate strings within a character vector

Description

Dependency-free drop-in alternative for stringr::str_pad().

Usage

str_pad(
  string,
  width,
  side = c("left", "right", "both"),
  pad = " ",
  use_width = TRUE
)

Value

A character vector.

Arguments

string

Input vector. Either a character vector, or something coercible to one.

width

Minimum width of padded strings.

side

Side on which padding character is added (left, right or both).

pad

Single padding character (default is a space).

use_width

If FALSE, use the length of the string instead of the width; see str_width()/str_length() for the difference.

Author

Eli Pousson eli.pousson@gmail.com (ORCID)

Alexander Rossell Hayes alexander@rossellhayes.com (ORCID)