scanf(fstr)
Instance Public methods
Scans the current string. If a block is given, it functions exactly like block_scanf.
arr = "123 456".scanf("%d%d") # => [123, 456] require 'pp' "this 123 read that 456 other".scanf("%s%d%s") {|m| pp m} # ["this", 123, "read"] # ["that", 456, "other"] # => [["this", 123, "read"], ["that", 456, "other"]]
See Scanf for details on creating a format string.
You will need to require 'scanf' to use #scanf
Please login to continue.