るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.109秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:ljust[x]

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

ライブラリ

クラス

検索結果

String#ljust(width, padding = ' ') -> String (24337.0)

長さ width の文字列に self を左詰めした文字列を返します。 self の長さが width より長い時には元の文字列の複製を返します。 また、第 2 引数 padding を指定したときは 空白文字の代わりに padding を詰めます。

...長さ width の文字列に self を左詰めした文字列を返します。
self の長さが width より長い時には元の文字列の複製を返します。
また、第 2 引数 padding を指定したときは
空白文字の代わりに padding を詰めます。

@param width...
...まで self の右側に詰める文字

//emlist[例][ruby]{
p "foo".ljust(10) # => "foo "
p "foo".ljust(9) # => "foo "
p "foo".ljust(8) # => "foo "
p "foo".ljust(2) # => "foo"
p "foo".ljust(1) # => "foo"
p "foo".ljust(10, "*") # => "foo******...