I have a string of HTML that I\'m copy pasting into a String object that looks something like the following:
val s = \"\"\" This is a tes
This is a tes
You could just
s.filter(_ >= ' ')
to throw away all control characters.
If you want to omit extra whitespace at the start/end of lines also, you can instead
s.split('\n').map(_.trim.filter(_ >= ' ')).mkString