るりまサーチ

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

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

String#scanf(format) -> Array (21014.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("%...
...を文字列で指定します。
詳細は、m:String#scanf#format を参照してください。

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

===[a:format] scanfフォーマット文字列

文字 '%' と(s,d のような)指...

String#scanf(format) {|*ary| ...} -> Array (21014.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("%...
...を文字列で指定します。
詳細は、m:String#scanf#format を参照してください。

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

===[a:format] scanfフォーマット文字列

文字 '%' と(s,d のような)指...

Scanf::FormatString#string_left (9103.0)

@todo

@todo

Scanf::FormatSpecifier#matched_string (6103.0)

@todo

@todo

Scanf::FormatSpecifier#re_string (6103.0)

@todo

@todo

絞り込み条件を変える

Scanf::FormatString (6002.0)

Scanf::FormatString#last_match_tried (3002.0)

@todo

@todo

Scanf::FormatString#last_spec (3002.0)

@todo

@todo

Scanf::FormatString#last_spec_tried (3002.0)

@todo

@todo

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

@todo

@todo

絞り込み条件を変える

Scanf::FormatString#matched_count (3002.0)

@todo

@todo

Scanf::FormatString#prune(n=matched_count) (3002.0)

@todo

@todo

Scanf::FormatString#space (3002.0)

@todo

@todo

Scanf::FormatString#spec_count (3002.0)

@todo

@todo

Scanf::FormatString#to_s (3002.0)

@todo

@todo

絞り込み条件を変える

Scanf::FormatString.new(str) (3002.0)

@todo

@todo

Scanf::FormatString::REGEX (3002.0)

@todo

@todo
<< 1 2 > >>