[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / doc / string / ljust.rdoc
blob8e23c1fc8fef16f0f71c72c61d360fdf039994ab
1 Returns a left-justified copy of +self+.
3 If integer argument +size+ is greater than the size (in characters) of +self+,
4 returns a new string of length +size+ that is a copy of +self+,
5 left justified and padded on the right with +pad_string+:
7   'hello'.ljust(10)       # => "hello     "
8   '  hello'.ljust(10)     # => "  hello   "
9   'hello'.ljust(10, 'ab') # => "helloababa"
10   'тест'.ljust(10)        # => "тест      "
11   'こんにちは'.ljust(10)    # => "こんにちは     "
13 If +size+ is not greater than the size of +self+, returns a copy of +self+:
15   'hello'.ljust(5)  # => "hello"
16   'hello'.ljust(1)  # => "hello"