elixir-lang/elixir — pull request #1593 by vanstee (2013-08-13 05:09:46+00:00)
Title: Implement string justification functions

:warning: Not yet ready to merge. Depends on https://github.com/elixir-lang/elixir/pull/1592.

Adding helper functions for string justification was mentioned here: https://github.com/elixir-lang/elixir/issues/1544#issuecomment-22068194

Right now the implementation takes a few things from the Erlang ([`string:right`](http://www.erlang.org/doc/man/string.html#right-2)) and Ruby ([`String#rjust`](http://ruby-doc.org/core-2.0/String.html#method-i-rjust)) methods. If the length passed in is shorter than the length of the original string then it is truncated and returned (like in Erlang). However, these methods also support multi-character strings as padding (like in Ruby). Everything else is pretty normal and common functionality between the two.

Any thoughts or suggestions? Totally open to changing the implementation.