20件ヒット
[1-20件を表示]
(0.012秒)
検索結果
-
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("%......%a
: %A
符号付き浮動小数点数
: %s
空白文字を含まない文字列
(幅が指定されているときは指定された文字数か空白文字の直前までの短い方)
: %c
1文字(幅が指定されているときは指定された文字数)
: [...]
d:spec/regexp#string... -
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("%......%a
: %A
符号付き浮動小数点数
: %s
空白文字を含まない文字列
(幅が指定されているときは指定された文字数か空白文字の直前までの短い方)
: %c
1文字(幅が指定されているときは指定された文字数)
: [...]
d:spec/regexp#string... -
NEWS for Ruby 2
. 5 . 0 (18.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...end with #<=> and raise a "bad value for range" ArgumentError
but instead lets the exception from the #<=> call go through.
7688
* Regexp
* Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05 に更新
* 非包含オペレータ(absence operator)をサポート https://......いうキーワード引数を受け取り、メンバーをキーワード引数で初期化できるようになりました。
11925
* Regexp/String: Unicodeのバージョンを 9.0.0 から 10.0.0 に更新しました。 13685
* Thread
* Thread#name= で設定した名前が Wi......* cmath
* csv
* date
* dbm
* etc
* fcntl
* fiddle
* fileutils
* gdbm
* ipaddr
* scanf
* sdbm
* stringio
* strscan
* webrick
* zlib
* Logger
* Logger.new("| command") は意図せず、コマンド...