るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

ARGF.class#gets(limit, chomp: false) -> String | nil (18188.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
#...
...$ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby...

ARGF.class#gets(rs = $/, chomp: false) -> String | nil (18188.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
#...
...$ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby...

ARGF.class#gets(rs, limit, chomp: false) -> String | nil (18188.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
#...
...$ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby...

ARGF.class#gets(limit) -> String | nil (18182.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...t.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@
see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#...

ARGF.class#gets(rs = $/) -> String | nil (18182.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...t.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@
see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#...

絞り込み条件を変える

ARGF.class#gets(rs, limit) -> String | nil (18182.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...t.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@
see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#...

StringIO#gets(rs = $/) -> String | nil (18138.0)

自身から 1 行読み込んで、その文字列を返します。文字列の終端に到達した時には nil を返します。 $_ に読み込んだ行がセットされます。

...セットされます。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切りなしとみなします。空文字列 "" を指定すると連続する改行を行の区切りとみなします(パラグラフモード)。

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

//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.gets #=> "hoge"
$_ #=> "hoge"
a.gets #=> nil
$_ #=> nil
//}

@
see $/...

CSV#gets -> Array | CSV::Row (18114.0)

String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。

...読み込み用にオープンされている必要があります。

@
return ヘッダを使用しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。

//emlist[例][ruby]{
require "csv"

csv = CSV.new(DATA.read)
csv.readline # => ["header1"...

CSV#readline -> Array | CSV::Row (3014.0)

String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。

...読み込み用にオープンされている必要があります。

@
return ヘッダを使用しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。

//emlist[例][ruby]{
require "csv"

csv = CSV.new(DATA.read)
csv.readline # => ["header1"...

CSV#shift -> Array | CSV::Row (3014.0)

String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。

...読み込み用にオープンされている必要があります。

@
return ヘッダを使用しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。

//emlist[例][ruby]{
require "csv"

csv = CSV.new(DATA.read)
csv.readline # => ["header1"...

絞り込み条件を変える

IO#each(limit, chomp: false) -> Enumerator (55.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...合があります。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切りなしとみなします。
空文字列 "" を指定すると連続する改行を行の区切りとみなします(パラグラフモード)。
@
param limit 最大の...
...読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

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

//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is...
...3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{...

IO#each(limit, chomp: false) {|line| ... } -> self (55.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...合があります。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切りなしとみなします。
空文字列 "" を指定すると連続する改行を行の区切りとみなします(パラグラフモード)。
@
param limit 最大の...
...読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

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

//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is...
...3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{...
<< 1 2 3 ... > >>