Reputation: 4128
When I execute
print("Enter your name: ")
name=gets
puts("\tHello, #{name}.")
, I get:
Hello, Fohsap
.
How do I move the period (.) up to the first line?
Upvotes: 2
Views: 1688
Reputation: 2590
gets
will include the newline character in the returned string. To remove that, you can use gets.chomp
.
Upvotes: 8