4.59. kink/io/STR_SCANNER

Provides str scanners.

4.59.1. STR_SCANNER.new(Str)

STR_SCANNER.new makes a scanner which scans text from the Str.

Precondition:

• Str must be a str.

The result scanner does not cause IO errors.

Example:

:STR_SCANNER.require_from('kink/io/')

:S <- STR_SCANNER.new("foo\nbar\nbaz\n")
stdout.print_line(S.scan_line.repr) # => "[foo\n]"
stdout.print_line(S.scan_rune.repr) # => [98]
stdout.print_line(S.scan_all.repr) # => "ar\nbaz\n"