Scala string FAQ: Does Scala have a
String method like chomp or chop that you find in Perl?
If you're using Scala and want a string
chop method that you're used to in languages like Perl to remove end of line characters, the
stripLineEnd method will do what you want, as shown in the REPL: