Skip to content

Instantly share code, notes, and snippets.

@mattgreen
Created March 24, 2016 16:09
Show Gist options
  • Save mattgreen/29d16ec566b8d9424e04 to your computer and use it in GitHub Desktop.
Save mattgreen/29d16ec566b8d9424e04 to your computer and use it in GitHub Desktop.
leftPad :: Int -> String -> String
leftPad n x
| length x >= n = x
| otherwise = padding ++ x
where
padding = replicate (n - length x) ' '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment