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 :
require 'strscan'
c = StringScanner. new ( "Fri Dec 12 1975 14:39" )
puts "String Scanner eos? form : #{c.eos?()}\n\n"
|
Output :
String Scanner eos? form : false
Example #2 :
require 'strscan'
c = StringScanner. new ( "hellogeeks" )
c.terminate
puts "String Scanner eos? form : #{c.eos?()}\n\n"
|
Output :
String Scanner eos? form : true
Last Updated :
12 Dec, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...