Mega Code Archive

 
Categories / Ruby / Development
 

Chomp takes off any Enters hanging out at the end of your string

puts 'Hello there, and what\'s your name?' name = gets.chomp puts 'Your name is ' + name + '?  What a lovely name!' puts 'Pleased to meet you, ' + name + '.  :)'