216件ヒット
[1-100件を表示]
(0.016秒)
別のキーワード
ライブラリ
- scanf (198)
クラス
- IO (12)
-
Scanf
:: FormatSpecifier (66) -
Scanf
:: FormatString (78) - String (12)
モジュール
- Kernel (12)
キーワード
- FormatSpecifier (6)
- FormatString (6)
-
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) - REGEX (6)
- SPECIFIERS (6)
- Scanf (6)
- conversion (6)
-
count
_ space? (6) -
last
_ match _ tried (6) -
last
_ spec (6) -
last
_ spec _ tried (6) - letter (6)
- match (12)
- matched (6)
-
matched
_ count (6) -
matched
_ string (6) -
mid
_ match? (6) - new (6)
- prune (6)
-
re
_ string (6) - space (6)
-
spec
_ count (6) -
string
_ left (6) -
to
_ re (6) -
to
_ s (12) - width (6)
検索結果
先頭5件
-
scanf (76140.0)
-
String#scan のフォーマット指定版といえるメソッド String#scanf を定義します。
...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......000.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 (52456.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 (52456.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 のような)指示... -
Kernel
# scanf(format) -> Array (52336.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 (52336.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 (52248.0) -
String#scanfも参照してください。
...String#scanfも参照してください。
@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。... -
IO
# scanf(format) {|*ary| . . . } -> Array (52248.0) -
String#scanfも参照してください。
...String#scanfも参照してください。
@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。... -
Scanf (28080.0)
-
scanf ライブラリで使用する名前空間です。
...scanf ライブラリで使用する名前空間です。
@see Kernel.#scanf, String#scanf, IO#scanf, Stdin#scanf... -
Scanf
:: FormatSpecifier (22000.0) -
-
Scanf
:: FormatSpecifier # conversion (22000.0) -
@todo
@todo -
Scanf
:: FormatSpecifier # count _ space? (22000.0) -
@todo
@todo -
Scanf
:: FormatSpecifier # letter (22000.0) -
@todo
@todo -
Scanf
:: FormatSpecifier # match(str) (22000.0) -
@todo
@todo -
Scanf
:: FormatSpecifier # matched (22000.0) -
@todo
@todo -
Scanf
:: FormatSpecifier # matched _ string (22000.0) -
@todo
@todo -
Scanf
:: FormatSpecifier # mid _ match? (22000.0) -
@todo
@todo -
Scanf
:: FormatSpecifier # re _ string (22000.0) -
@todo
@todo