1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/doc/string/bytesize.rdoc
Burdette Lamar 0b0ae583f4
[DOC] Enhanced RDoc for String (#5753)
Treats:
    #length
    #bytesize
2022-04-03 10:09:34 -05:00

11 lines
287 B
Text

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