diff options
author | Burdette Lamar <[email protected]> | 2022-04-03 10:09:34 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2022-04-03 10:09:34 -0500 |
commit | 0b0ae583f4e25e378294df5e19a76f9fd541a6d0 (patch) | |
tree | 657f8d8c4c9cb56a6276138e3216f324f27ceed7 /doc/string/bytesize.rdoc | |
parent | f801386f0c7051085da9d6ca660642f3aa08c81e (diff) |
[DOC] Enhanced RDoc for String (#5753)
Treats:
#length
#bytesize
Notes
Notes:
Merged-By: BurdetteLamar <[email protected]>
Diffstat (limited to 'doc/string/bytesize.rdoc')
-rw-r--r-- | doc/string/bytesize.rdoc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/string/bytesize.rdoc b/doc/string/bytesize.rdoc new file mode 100644 index 0000000000..b0567ff67b --- /dev/null +++ b/doc/string/bytesize.rdoc @@ -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 |