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