るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.031秒)
トップページ > クラス:IO[x] > クエリ:write[x] > クエリ:getc[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. rexml/document write
  2. _builtin write
  3. io write
  4. tuple write
  5. stringio write

検索結果

IO#getc -> String | nil (18134.0)

IO ポートから外部エンコーディングに従い 1 文字読み込んで返します。 EOF に到達した時には nil を返します。

...
IO
ポートから外部エンコーディングに従い 1 文字読み込んで返します。
EOF に到達した時には nil を返します。

テキスト読み込みメソッドとして動作します。

IO
#readchar との違いは EOF での振る舞いのみです。

@raise IOError...
...ープンされていなければ発生します。

例:
File.write("testfile", "test")
f = File.new("testfile")
p f.getc #=> "い"
p f.getc #=> "ろ"
p f.getc #=> "は"
f.read
f.getc #=> nil

@see IO#readchar...