From: Mark Slagell Date: 2001-01-08T23:28:57+09:00 Subject: [ruby-talk:8866] Re: About string return from IO::gets "and.u" wrote: > > How to limit string which return from IO::gets max length ? One way is: inp = gets[0,length] "[0,length]" truncates what gets assigned to inp, though before that happens, IO::gets can invisibly generate a string of arbitrary length. I think from a security standpoint that isn't a problem, but maybe somebody will correct me. Mark