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 code for StringIO.eos?() method # loading StringIOrequire 'strscan' # declaring StringIO c = StringScanner.new("Fri Dec 12 1975 14:39") # eos?() methodputs "String Scanner eos? form : #{c.eos?()}\n\n" |
Output :
String Scanner eos? form : false
Example #2 :
# Ruby code for StringIO.eos?() method # loading StringIOrequire 'strscan' # declaring StringIO c = StringScanner.new("hellogeeks") # stringIO is terminatedc.terminate # eos?() methodputs "String Scanner eos? form : #{c.eos?()}\n\n" |
Output :
String Scanner eos? form : true


