ruby/doc/string/length.rdoc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 строки
293 B
Plaintext
Исходник Обычный вид История

Returns the count of characters (not bytes) in +self+:
'foo'.length # => 3
'тест'.length # => 4
'こんにちは'.length # => 5
Contrast with String#bytesize:
'foo'.bytesize # => 3
'тест'.bytesize # => 8
'こんにちは'.bytesize # => 15