We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1ce569 commit db6f397Copy full SHA for db6f397
doc/string/bytesize.rdoc
@@ -1,11 +1,15 @@
1
-Returns the count of bytes (not characters) in +self+:
+Returns the count of bytes in +self+.
2
3
- 'foo'.bytesize # => 3
4
- 'тест'.bytesize # => 8
5
- 'こんにちは'.bytesize # => 15
+Note that the byte count may be different from the character count (returned by #size):
6
7
-Contrast with String#length:
+ s = 'foo'
+ s.bytesize # => 3
+ s.size # => 3
8
+ s = 'тест'
9
+ s.bytesize # => 8
10
+ s.size # => 4
11
+ s = 'こんにちは'
12
+ s.bytesize # => 15
13
+ s.size # => 5
14
- 'foo'.length # => 3
- 'тест'.length # => 4
- 'こんにちは'.length # => 5
15
+Related: see {Querying}[rdoc-ref:String@Querying].
0 commit comments