mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
0b0ae583f4
Treats: #length #bytesize
13 lines
336 B
Text
13 lines
336 B
Text
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
|
|
|
|
String#size is an alias for String#length.
|