Ruby | StringScanner empty? function Last Updated : 12 Dec, 2019 Comments Improve Suggest changes Like Article Like Report StringScanner#empty?() : empty?() is a StringScanner class method which checks whether the stringIO is empty. Syntax: StringScanner.empty?() Parameter: StringScanner values Return: true - if the stringIO is empty otherwise return false Example #1 : Ruby # Ruby code for StringIO.empty?() method # loading StringIO require 'strscan' # declaring StringIO c = StringScanner.new("Fri Dec 12 1975 14:39") # empty?() method puts "String Scanner empty? form : #{c.empty?()}\n\n" Output : String Scanner empty? form : false Example #2 : Ruby # Ruby code for StringIO.empty?() method # loading StringIO require 'strscan' # declaring StringIO c = StringScanner.new("hellogeeks") # empty?() method puts "String Scanner empty? form : #{c.empty?()}\n\n" Output : String Scanner empty? form : false Comment More infoAdvertise with us Next Article Ruby | StringScanner empty? function M mayank5326 Follow Improve Article Tags : Ruby Ruby-Methods Ruby String Scanner-class Similar Reads Ruby | StringScanner exist? function StringScanner#exist?() : exist?() is a StringScanner class method which returns the value of pointer if the pattern exists. Syntax: StringScanner.exist?()Parameter: StringScanner valuesReturn: the value of pointer - if the pattern exists otherwise return nil. Example #1 :  Ruby # Ruby code for Str 1 min read Ruby | StringScanner eos? function StringScanner#eos?() : eos?() is a StringScanner class method which checks whether the scan pointer is at the end of the string. Syntax: StringScanner.eos?() Parameter: StringScanner values Return: true if the scan pointer is at the end of the string otherwise return false Example #1 : Ruby # Ruby c 1 min read Ruby | StringScanner check function StringScanner#check() : check() is a StringScanner class method which returns the value that scan would return, without advancing the scan pointer Syntax: StringScanner.check() Parameter: StringScanner values Return: the value that scan would return, without advancing the scan pointer Example #1 : R 1 min read Ruby | StringScanner clear function StringScanner#clear() : clear() is a StringScanner class method which terminates the stringIO and returns an Enumerator object for the StringIO. Syntax: StringScanner.clear() Parameter: StringScanner values Return: terminates the stringIO and returns an Enumerator object for the StringIO. Example #1 1 min read Ruby | StringScanner charpos function StringScanner#charpos() : charpos() is a StringScanner class method which returns the character position of the scan pointer. Syntax: StringScanner.charpos() Parameter: StringScanner values Return: the character position of the scan pointer Example #1 : Ruby # Ruby code for StringIO.charpos() method 1 min read Like