File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1+ Reads and returns the next character from the stream:
2+
3+ strio = StringIO.new('foo')
4+ strio.getc # => "f"
5+ strio.getc # => "o"
6+ strio.getc # => "o"
7+
8+ Returns +nil+ if at end-of-stream:
9+
10+ strio.eof? # => true
11+ strio.getc # => nil
12+
13+ Returns characters, not bytes:
14+
15+ strio = StringIO.new('тест')
16+ strio.getc # => "т"
17+ strio.getc # => "е"
18+
19+ strio = StringIO.new('こんにちは')
20+ strio.getc # => "こ"
21+ strio.getc # => "ん"
22+
23+ Related: StringIO.getbyte.
Original file line number Diff line number Diff line change @@ -958,8 +958,8 @@ strio_each_byte(VALUE self)
958958 * call-seq:
959959 * getc -> character or nil
960960 *
961- * Reads and returns the next character from the stream;
962- * see {Character IO}[rdoc-ref:IO@Character+IO].
961+ * :include: stringio/getc.rdoc
962+ *
963963 */
964964static VALUE
965965strio_getc (VALUE self )
You can’t perform that action at this time.
0 commit comments