Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Stringクラス > length

instance method String#length

length -> Integer
size -> Integer

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

[SEE_ALSO] String#bytesize

class String