String in Scala is simply java.lang.String. You can use String just like you do in Java. However, Scala does provide a few additional conveniences when working with String.
Scala can automatically convert a String to scala.runtime.RichString. This brings a few useful methods like capitalize, lines, and reverse to String.
It’s really simple in Scala to create a string that runs multiple lines—no more of those messy +=. Place the multiple lines of strings within three double quotes ("""…"""). That’s Scala’s support for the so-called here documents, or heredocs. To see it in action, let’s create a string that runs a few lines long:
val str = """In his famous inaugural speech, ...