# Add padding to string — add_padding • stRoke
Add padding to string

Skip to contents

# Add padding to string

Source: `R/add_padding.R`
`add_padding.Rd`

Add padding to string

## Usage

    add_padding(d, length = NULL, after = FALSE, pad = "0")

## Arguments

d

  vector of strings or numbers

length

  final string length

after

  if padding should be added after as opposed to default before

pad

  padding string of length 1

## Value

vector or character strings of same length.

## Examples

    add_padding(sample(1:200,5))
    #> [1] "137" "178" "073" "172" "066"