るりまサーチ

最速Rubyリファレンスマニュアル検索!
218件ヒット [1-100件を表示] (0.079秒)
トップページ > クエリ:a[x] > クエリ:scanf[x]

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 > >>

scanf (44154.0)

String#scan のフォーマット指定版といえるメソッド String#scanf を定義します。

...String#scan のフォーマット指定版といえるメソッド String#scanf
を定義します。

組み込みクラス String と IO を拡張します。

=== 例
require 'scanf'

p "a 10 1.2". scanf("%s %d %f") # => ["a", 10, 1.2]
p "a 10 1.2 b 20 1.5e10".scanf("%s %d...
...%f") # => ["a", 10, 1.2]
p "a 10 1.2 b 20 1.5e10".scanf("%s %d %f") {|*v| v}
# => [["a", 10, 1.2], ["b", 20, 15000000000.0]]

p "a 10 1.2 b 20 1.5e10 c".scanf("%s %d %f") {|*v| v}
# => [["a", 10, 1.2], ["b", 20, 15000000000.0], [["c"]]]...
...# [["c"]] (?)

require 'scanf'
p "a, 10, 1.2".scanf("%s,%d,%f")
# => ["a,"] %s が "," を飲み込むからダメらしい

p "a, 10, 1.2".scanf("%1s,%d,%f")
# => ["a", 10, 1.2]

p "a, 10, 1.2".scanf("%[^,],%d,%f")
# => ["a", 10, 1.2]...

String#scanf(format) -> Array (32394.0)

ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。

...字列を format に従って変
換し、そのオブジェクトの配列を返します。
format で指定した文字列が見つからない場合は空の配列を
生成して返します。

require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]

ブロ...
... scanf を継続して実行し、順次
見つかった文字列を変換したオブジェクトの配列を引数に、ブロックを
実行します。このとき、ブロックの実行結果を要素とする配列を返します。

require 'scanf'
str = "123 0x45 678 0x90"
p str.scan...
...4]]

formatに完全にマッチしていなくても、部分的にマッチしていれば、
ブロックは実行されます。

require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%s%d") { |s, n| [s, n] }
p ret #=> [["123", nil], ["abc", 456], ["def", nil]]


@param format スキ...

String#scanf(format) {|*ary| ...} -> Array (32394.0)

ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。

...字列を format に従って変
換し、そのオブジェクトの配列を返します。
format で指定した文字列が見つからない場合は空の配列を
生成して返します。

require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]

ブロ...
... scanf を継続して実行し、順次
見つかった文字列を変換したオブジェクトの配列を引数に、ブロックを
実行します。このとき、ブロックの実行結果を要素とする配列を返します。

require 'scanf'
str = "123 0x45 678 0x90"
p str.scan...
...4]]

formatに完全にマッチしていなくても、部分的にマッチしていれば、
ブロックは実行されます。

require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%s%d") { |s, n| [s, n] }
p ret #=> [["123", nil], ["abc", 456], ["def", nil]]


@param format スキ...

Kernel#scanf(format) -> Array (32268.0)

STDIN.scanf と同じです。 IO#scanf、Stdin#scanfも参照してください。

...STDIN.scanf と同じです。
IO#scanf、Stdin#scanfも参照してください。

@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。

@see IO#scanf, Stdin#scanf...

Kernel#scanf(format) {|*ary| ...} -> Array (32268.0)

STDIN.scanf と同じです。 IO#scanf、Stdin#scanfも参照してください。

...STDIN.scanf と同じです。
IO#scanf、Stdin#scanfも参照してください。

@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。

@see IO#scanf, Stdin#scanf...

絞り込み条件を変える

IO#scanf(format) -> Array (32224.0)

String#scanfも参照してください。

...String#scanfも参照してください。

@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。...

IO#scanf(format) {|*ary| ...} -> Array (32224.0)

String#scanfも参照してください。

...String#scanfも参照してください。

@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。...

Scanf (20040.0)

scanf ライブラリで使用する名前空間です。

...scanf ライブラリで使用する名前空間です。

@see Kernel.#scanf, String#scanf, IO#scanf, Stdin#scanf...

Scanf::FormatSpecifier#count_space? (17100.0)

@todo

@todo

Scanf::FormatSpecifier#match(str) (17100.0)

@todo

@todo

絞り込み条件を変える

Scanf::FormatSpecifier#matched (17100.0)

@todo

@todo

Scanf::FormatSpecifier#matched_string (17100.0)

@todo

@todo

Scanf::FormatSpecifier#mid_match? (17100.0)

@todo

@todo

Scanf::FormatString#last_match_tried (17100.0)

@todo

@todo

Scanf::FormatString#last_spec (17100.0)

@todo

@todo

絞り込み条件を変える

Scanf::FormatString#last_spec_tried (17100.0)

@todo

@todo

Scanf::FormatString#match(str) (17100.0)

@todo

@todo
<< 1 2 3 > >>