Skip to content
instance method

StringScanner#pointer

() -> ::Integer
pointer

Alias of #pos

call-seq: pos -> byte_position

Returns the integer byte position, which may be different from the character position:

Example
scanner = StringScanner.new(HIRAGANA_TEXT)
scanner.string  # => "こんにちは"
scanner.pos     # => 0
scanner.getch   # => "こ" # 3-byte character.
scanner.charpos # => 1
scanner.pos     # => 3
See also #pos #pointer= #peek_byte #peek also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0