るりまサーチ

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

別のキーワード

  1. scanf scanf
  2. string scanf
  3. io scanf
  4. kernel scanf
  5. scanf match

ライブラリ

検索結果

Scanf::FormatString#space (29101.0)

@todo

@todo

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

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

...列が見つからない場合は空の配列を
生成して返します。

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

ブロックを指定した場合は scanf を継続して実行し、順次
見つかった文字列を変換したオブジェ...
...re 'scanf'
str = "123 0x45 678 0x90"
p str.scanf("%d%x"){|n, s| [n, s]}
#=> [[123, 69], [678, 144]]

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

require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%...
...require 'scanf'
str = "1234"
p str.scanf("%1s%3d") #=> ["1", 234]

また、1.9 以降では、スペースには全角文字列が含まれます。

動作例;
# encoding: utf-8
require 'scanf'

str = "1     aaa"
p str.scanf("%d %s") #=> [1, "aaa"]



: space
フォー...

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

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

...列が見つからない場合は空の配列を
生成して返します。

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

ブロックを指定した場合は scanf を継続して実行し、順次
見つかった文字列を変換したオブジェ...
...re 'scanf'
str = "123 0x45 678 0x90"
p str.scanf("%d%x"){|n, s| [n, s]}
#=> [[123, 69], [678, 144]]

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

require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%...
...require 'scanf'
str = "1234"
p str.scanf("%1s%3d") #=> ["1", 234]

また、1.9 以降では、スペースには全角文字列が含まれます。

動作例;
# encoding: utf-8
require 'scanf'

str = "1     aaa"
p str.scanf("%d %s") #=> [1, "aaa"]



: space
フォー...

Scanf::FormatSpecifier#count_space? (17101.0)

@todo

@todo