StringScanner#inspect() : inspect() is a StringScanner class method which returns string that represents the StringScanner object showing different values.
Syntax: StringScanner.inspect()
Parameter: StringScanner values
Return: – the current position
– the size of the string
– the characters surrounding the scan pointer
Example #1 :
require 'strscan'
c = StringScanner. new ( "Mon Sep 12 2018 14:39" )
puts "String Scanner inspect form : #{c.inspect()}\n\n"
|
Output :
String Scanner inspect form : #
Example #2 :
require 'strscan'
c = StringScanner. new ( "hellogeeks" )
puts "String Scanner inspect form : #{c.inspect()}\n\n"
|
Output :
String Scanner inspect form : #
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
09 Dec, 2019
Like Article
Save Article