+ 12

Why we use gets. chomp method? Instead we can use gets only..

24th May 2019, 10:08 PM
HĂ«llo Wörld🔰
HĂ«llo Wörld🔰 - avatar
2 Answers
+ 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
25th May 2019, 12:54 AM
Lord Krishna
Lord Krishna - avatar
+ 11
Thank you Lord Krishna
25th May 2019, 4:51 AM
HĂ«llo Wörld🔰
HĂ«llo Wörld🔰 - avatar