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

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
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
2
3
4
## Not run: 
strpad(1:5, width = 4, pad = "0")

## End(Not run)

OOmegaPPanDDa/tmcn documentation built on May 7, 2019, 8:55 p.m.