What’s the difference between STDIN.gets() and gets.chomp() in Ruby? Aren’t they both retrieving raw input from the user?
side question: If I want to convert their input into an integer, do I do
myNumb = Integer(STDIN.gets())
and
myNumb = Integer(gets.chomp())
Easiest way to do what you describe here is
Integer(gets), sinceInteger()ignores the trailing newline, sochompis unnecessary. There’s also no need explicitly specifySTDINas the receiver, as that’s what Kernel#gets will do if there are no arguments to the script.