From: Tom Reilly Date: 2013-03-29T08:50:17+09:00 Subject: Re: clear the STDIN Love U Ruby wrote: > C:\>irb --simple-prompt > DL is deprecated, please use Fiddle >>> STDIN.gets > I am > => "I am\n" > > Now how to print and clear the content of STDIN? If you are using short programs where you request something from STDIN then want to do a bit of processing then have it print out without waiting for some other event do this: > $stdout.sync = true a = gets.chomp # process a print "#{a} /n" Tom Reilly >