strpad: Pad a string to a specified length with a padding character.

Description Usage Arguments Value Author(s) Examples

View source: R/strpad.R

Description

Pad a string to a specified length with a padding character.

Usage

1
2
strpad(string, width = 0, side = c("left", "right", "both"),
  pad = " ")

Arguments

string

A character vector.

width

The number of characters of the string after padding.

side

Which side to pad.

pad

The padding character.

Value

A character vector after padding.

Author(s)

Jian Li <rweibo@sina.com>

Examples

1
strpad(1:5, width = 4, pad = "0")

tmcn documentation built on Aug. 4, 2019, 3 p.m.

Related to strpad in tmcn...