1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[DOC] Enhanced RDoc for String (#5753)

Treats:
    #length
    #bytesize
This commit is contained in:
Burdette Lamar 2022-04-03 10:09:34 -05:00 committed by GitHub
parent f801386f0c
commit 0b0ae583f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2022-04-04 00:10:05 +09:00
Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
3 changed files with 26 additions and 12 deletions

11
doc/string/bytesize.rdoc Normal file
View file

@ -0,0 +1,11 @@
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