Skip to content

Commit 66360ee

Browse files
[DOC] Tweaks for StringIO.getbyte (#188)
1 parent a7c118d commit 66360ee

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/stringio/getbyte.rdoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@ Returns +nil+ if at end-of-stream:
1414

1515
Returns a byte, not a character:
1616

17-
s = 'тест'
18-
s.bytes # => [209, 130, 208, 181, 209, 129, 209, 130]
17+
s = 'Привет'
18+
s.bytes
19+
# => [208, 159, 209, 128, 208, 184, 208, 178, 208, 181, 209, 130]
1920
strio = StringIO.new(s)
20-
strio.getbyte # => 209
21-
strio.getbyte # => 130
21+
strio.getbyte # => 208
22+
strio.getbyte # => 159
2223

2324
s = 'こんにちは'
24-
s.bytes # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175]
25+
s.bytes
26+
# => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175]
2527
strio = StringIO.new(s)
2628
strio.getbyte # => 227
2729
strio.getbyte # => 129
2830

29-
Related: StringIO.getc.
31+
Related: #each_byte, #ungetbyte, #getc.

0 commit comments

Comments
 (0)