method

getch

v1_8_7_330 - Show latest stable - Class: StringScanner
getch()
public

Scans one character and returns it. This method is multi-byte character sensitive. See also #get_byte.

s = StringScanner.new('ab')
s.getch           # => "a"
s.getch           # => "b"
s.getch           # => nil

$KCODE = 'EUC'
s = StringScanner.new("\244\242")
s.getch           # => "\244\242"   # Japanese hira-kana "A" in EUC-JP
s.getch           # => nil