diff options
| author | Burdette Lamar <BurdetteLamar@Yahoo.com> | 2025-12-06 17:18:18 -0600 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-12-10 15:16:53 +0900 |
| commit | f623fcc7d069cdfcaf25285c986ed995530a686f (patch) | |
| tree | 080a4cf0ec8dccdfdfc36e452e6c5bb5f0022bcf /doc | |
| parent | 668fe01182df185c3592061e22087b6454132fec (diff) | |
[ruby/stringio] [DOC] Tweaks for StringIO.getbyte
(https://github.com/ruby/stringio/pull/188)
https://github.com/ruby/stringio/commit/66360ee5f1
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/stringio/getbyte.rdoc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/stringio/getbyte.rdoc b/doc/stringio/getbyte.rdoc index 48c334b525..5e524941bc 100644 --- a/doc/stringio/getbyte.rdoc +++ b/doc/stringio/getbyte.rdoc @@ -14,16 +14,18 @@ Returns +nil+ if at end-of-stream: Returns a byte, not a character: - s = 'тест' - s.bytes # => [209, 130, 208, 181, 209, 129, 209, 130] + s = 'Привет' + s.bytes + # => [208, 159, 209, 128, 208, 184, 208, 178, 208, 181, 209, 130] strio = StringIO.new(s) - strio.getbyte # => 209 - strio.getbyte # => 130 + strio.getbyte # => 208 + strio.getbyte # => 159 s = 'こんにちは' - s.bytes # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] + s.bytes + # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] strio = StringIO.new(s) strio.getbyte # => 227 strio.getbyte # => 129 -Related: StringIO.getc. +Related: #each_byte, #ungetbyte, #getc. |
