Returns a string that represents the StringScanner object, showing:
- the current position
- the size of the string
- the characters surrounding the scan pointer
public inspect ( ) |
public function testInspect() { $s = new StringScanner("Fri Dec 12 1975 14:39"); $this->assertEquals('#<StringScanner 0/21 @ "Fri D...">', $s->inspect()); $s->scanUntil('/12/'); # -> "Fri Dec 12" $this->assertEquals(10, $s->pos); $this->assertEquals('#<StringScanner 10/21 "...ec 12" @ " 1975...">', $s->inspect()); }