Use while loop to read a command : gets « Development « Ruby
- Ruby
- Development
- gets
Use while loop to read a command
command = ''
while command != 'bye'
puts command
command = gets.chomp
end
puts 'Come again soon!'
Related examples in the same category