るりまサーチ

最速Rubyリファレンスマニュアル検索!
504件ヒット [1-100件を表示] (0.081秒)

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils cp_r
  5. bigdecimal to_r

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

IO#print(*arg) -> nil (24222.0)

引数を IO ポートに順に出力します。引数を省略した場合は、$_ を出力します。

...param arg Kernel.#print と同じです。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX 出力に失敗した場合に発生します。

//emlist[例][ruby]{
$stdout.print("This is ", 100, " percent.\n") # => This is 100 perce...
...nt.
//}

@see Kernel.#print...

ARGF.class#print(*arg) -> nil (24210.0)

引数を順に処理対象のファイルに出力します。

...引数を順に処理対象のファイルに出力します。

c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は Kernel.#print と同じです。

@param arg 出力するオブジェクトを任意個指定します。...

IO#printf(format, *arg) -> nil (12209.0)

C 言語の printf と同じように、format に従い引数 を文字列に変換して、self に出力します。

... printf と同じように、format に従い引数
を文字列に変換して、self に出力します。

第一引数に IO を指定できないこと、引数を省略できないことを除けば Kernel.#printf と同じです。

@param format Kernel.#printf と同じです。print_format...
...を参照してください。

@param arg Kernel.#printf と同じです。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX 出力に失敗した場合に発生します。


@see Kernel.#printf...

ARGF.class#printf(format, *arg) -> nil (12203.0)

C 言語の printf と同じように、format に従い引数を 文字列に変換して処理対象のファイルに出力します。

... printf と同じように、format に従い引数を
文字列に変換して処理対象のファイルに出力します。

c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は出力先を指定しない形式の Kernel.#print...
...f と同じです。

@param format フォーマット文字列です。
@param arg フォーマットされる引数です。...

IO#each_char -> Enumerator (6209.0)

self に含まれる文字を一文字ずつブロックに渡して評価します。

...ません。

ブロックを省略した場合は各文字について繰り返す Enumerator を返します。

@raise IOError self が読み込み用にオープンされていない場合に発生します。

f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>...

絞り込み条件を変える

String#each_char -> Enumerator (6209.0)

文字列の各文字に対して繰り返します。

...文字列の各文字に対して繰り返します。

たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界

@see String#chars...

IO#close_write -> nil (6115.0)

書き込み用の IO を close します。

...@raise IOError 自身が書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: not opened for writin...
...g
end
//}

@see IO#close, IO#closed?, IO#close_read...
...@raise IOError 自身が書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: not opened for writing...
...end
//}

@see IO#close, IO#closed?, IO#close_read...

IO#reopen(path) -> self (6115.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パスを開く際のモードを文字列で指定します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis...
...)
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel....

IO#reopen(path, mode) -> self (6115.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パスを開く際のモードを文字列で指定します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis...
...)
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel....
<< 1 2 3 ... > >>