Can you change the example of use the .chomp method? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can you change the example of use the .chomp method?

In the proposed application of the .chomp method, there is no difference in the resulting output from the use of the gets method with .chomp and without .chomp. Thank.

30th Sep 2019, 3:02 PM
Goman Vladimir
Goman Vladimir - avatar
1 Answer
+ 1
".chomp" removes line breaks from a string. Example: "James\nBolton"
6th Oct 2019, 11:02 AM
Edijs Burger
Edijs Burger - avatar