# Scanf::String (Class)

In: | scanf.rb
Parent: | Object

## Methods

block_scanf scanf

## Public Instance methods

scanf(fstr,&b)

[Source]

    # File scanf.rb, line 665
      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

block_scanf(fstr,&b) {|current| ...}

[Source]

    # File scanf.rb, line 679
      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

[Validate]