use gets method to read from standard input (text from your keyboard, by default). : gets « Development « Ruby
- Ruby
- Development
- gets
use gets method to read from standard input (text from your keyboard, by default).
#!/usr/bin/env ruby
print "Who do you want to say hello to? "
hello = gets
puts "Hello, " + hello
Related examples in the same category