leftpad v1.0.1 Leftpad

Remembering String.rjust/3 can be difficult, so Leftpad provides you another way to easily left pad/right justify your UTF-8 encoded binaries.

Summary

Functions

Provides basically the same functionality as String.rjust/3

Functions

pad(string, count, char \\ 32)

Specs

pad(string :: String.t, count :: non_neg_integer, char :: char) :: String.t

Provides basically the same functionality as String.rjust/3

Examples

iex> Leftpad.pad("foo", 5)
"  foo"

iex> Leftpad.pad("foobar", 6)
"foobar"

iex> Leftpad.pad("1", 2, ?0)
"01"