るりまサーチ (Ruby 2.2.0)

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

別のキーワード

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

ライブラリ

検索結果

IO#getc -> String | nil (54397.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...