Ruby | StringScanner beginning_of_line? function
Last Updated :
10 Dec, 2019
StringScanner#beginning_of_line?() : beginning_of_line?() is a StringScanner class method which checks whether the scan pointer is at the beginning of the line.
Syntax: StringScanner.beginning_of_line?()
Parameter: StringScanner values
Return: true – if scan pointer is at the beginning of the line otherwise return false
Example #1 :
require 'strscan'
c = StringScanner. new ( 'hi' )
puts "StringScanner beginning_of_line? form : #{c.beginning_of_line?}\n\n"
|
Output :
StringScanner << bytes form : true
Example #2 :
require 'strscan'
c = StringScanner. new ( 'geeksforgeeks' )
puts "StringScanner beginning_of_line? form : #{c.beginning_of_line?}\n\n"
|
Output :
StringScanner << bytes form : true
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...