Class | Scanf::String
In: | scanf.rb
Parent: | Object

### Methods

block_scanf scanf

### Public Instance methods

block_scanf(fstr) {|current| ...}

[Source]

    # File scanf.rb, line 684
      def block_scanf(fstr,&b)
        fs = Scanf::FormatString.new(fstr)
        str = self.dup
        final = []
        begin
          current = str.scanf(fs)
          final.push(yield(current)) unless current.empty?
          str = fs.string_left
        end until current.empty? || str.empty?
        return final
      end

scanf(fstr,&b)

[Source]

    # File scanf.rb, line 670
      def scanf(fstr,&b)
        if b
          block_scanf(fstr,&b)
        else
          fs =
            if fstr.is_a? Scanf::FormatString
              fstr
            else
              Scanf::FormatString.new(fstr)
            end
          fs.match(self)
        end
      end

[Validate]