answersLogoWhite

0

Most commonly it's used to remove the newline character from the end of a string or an array of strings. If the newline character isn't there, then nothing is done to the string.

There are other details involved in what chomp does, but mostly that is what it is used for.

For instance you can change which character is considered the be the newline character. If you want to know more, I would suggest reading the documentation.

User Avatar

Wiki User

15y ago

What else can I help you with?