In message "[ruby-talk:8846] About string return from IO::gets"
on 01/01/08, "and.u" <is.r / com.is-andy.com> writes:
>How to limit string which return from IO::gets max length ?
Do you really need reading a *line*? IO#gets is a line-oriented
interface of IO. If you would do something to control input buffer,
you maybe have to IO#read or IO#sysread, which can take an optional
argument to specify the length.
Otherwise, Mark's comment [ruby-talk:8866] might help you.
-- Gotoken
p.s. We denote by `IO::gets' a class method `gets' (which does not
exist as built-in); IO#gets stands for an instance method `gets'
of IO. These distinction make our comminication clearer :-)