From: "Phil H." Date: 2013-03-30T00:55:08+09:00 Subject: Nil or enter with no input How can I tell if someone has enter nothing in a gets prompt, they only press enter. I though maybe it was nil, but that doesn't seem to work. I though this was going to work nicely, but doesn't. # Building and sorting an array. array = [] word = 'foo' while word != nil puts 'Enter a word' word = gets array.push word end puts array.sort -- Posted via http://www.ruby-forum.com/.