Add character to left of every character
pad_left(.x, .n, padding_char = "0")
Use this function to add specific character to the left of each element in a given vector.
The output is a character vector and default padding character is "0".
pad_left(1, 3)
#> [1] "001"
pad_left(c(1, 10), 4, "Z")
#> [1] "ZZZ1" "ZZ10"