Skip to content

Instantly share code, notes, and snippets.

@jrnold
Created February 14, 2016 03:48
Show Gist options
  • Save jrnold/dcc7de27de16af44d75b to your computer and use it in GitHub Desktop.
Save jrnold/dcc7de27de16af44d75b to your computer and use it in GitHub Desktop.
Padding a string with 0's
library("stringr")
str_pad(c(1, 12, 123, 1234, 12345), 5, side = "left", pad = "0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment