+ 12
Why we use gets. chomp method? Instead we can use gets only..
2 odpowiedzi
+ 7
By default gets method will add a newline to your input.
To remove it we use the chomp method
g= gets #provide some input, lets say 'hi'.
puts g+"hi"
# hi
# hi
puts g.chomp + "hi"
#hi hi
+ 11
Thank you Lord Krishna