Ruby | StringScanner pointer= function Last Updated : 10 Dec, 2019 Comments Improve Suggest changes Like Article Like Report StringScanner#pointer=() : pointer=() is a StringScanner class method which sets the byte position of the scan pointer. Syntax: StringScanner.pointer=() Parameter: StringScanner values Return: sets the byte pointerition of the scan pointer. Example #1 : Ruby # Ruby code for StringScanner.pointer=() method # loading StringScanner require 'strscan' # declaring StringScanner c = StringScanner.new("Mon Sep 12 2018 14:39") # pointer=() method c.pointer = 2 puts "#{c.rest}\n\n" # pointer=() method c.pointer = 20 puts "#{c.rest}\n\n" Output : n Sep 12 2018 14:39 9 Example #2 : Ruby # Ruby code for StringScanner.pointer=() method # loading StringScanner require 'strscan' # declaring StringScanner c = StringScanner.new("hellogeeks") # pointer=() method c.pointer = 2 puts "#{c.rest}\n\n" # pointer=() method c.pointer = 7 puts "#{c.rest}\n\n" Output : llogeeks eks Comment More infoAdvertise with us Next Article Ruby | StringScanner pointer function M mayank5326 Follow Improve Article Tags : Ruby Ruby-Methods Ruby String Scanner-class Similar Reads Ruby | StringScanner pointer function StringScanner#pointer() : pointer() is a StringScanner class method which returns the byte position of the scan pointer Syntax: StringScanner.pointer() Parameter: StringScanner values Return: the byte position of the scan pointer Example #1 : Ruby # Ruby code for StringScanner.pointer() method # loa 1 min read Ruby | StringScanner pointer function StringScanner#pointer() : pointer() is a StringScanner class method which returns the byte position of the scan pointer Syntax: StringScanner.pointer() Parameter: StringScanner values Return: the byte position of the scan pointer Example #1 : Ruby # Ruby code for StringScanner.pointer() method # loa 1 min read Ruby | StringScanner pos= function StringScanner#pos=() : pos=() is a StringScanner class method which sets the byte position of the scan pointer. Syntax: StringScanner.pos=() Parameter: StringScanner values Return: sets the byte position of the scan pointer. Example #1 : Ruby # Ruby code for StringScanner.pos=() method # loading Str 1 min read Ruby | StringScanner pos= function StringScanner#pos=() : pos=() is a StringScanner class method which sets the byte position of the scan pointer. Syntax: StringScanner.pos=() Parameter: StringScanner values Return: sets the byte position of the scan pointer. Example #1 : Ruby # Ruby code for StringScanner.pos=() method # loading Str 1 min read Ruby | StringScanner pos function StringScanner#pos() : pos() is a StringScanner class method which returns the byte position of the scan pointer Syntax: StringScanner.pos() Parameter: StringScanner values Return: the byte position of the scan pointer Example #1 : Ruby # Ruby code for StringScanner.pos() method # loading StringScann 1 min read Ruby | StringScanner pos function StringScanner#pos() : pos() is a StringScanner class method which returns the byte position of the scan pointer Syntax: StringScanner.pos() Parameter: StringScanner values Return: the byte position of the scan pointer Example #1 : Ruby # Ruby code for StringScanner.pos() method # loading StringScann 1 min read Like