Friday 14 August 2020

Scala: Triple quotes to handle multi line strings

You can use """ to define a string that spawns across multiple lines.

scala> var quote = """ Posted by Frederic Brussat on July 3, 2020
     | Share
     | Literary Wisdom
     | 
     | Hope is a renewable option: If you run out of it at the end of the day, you get to start over in the morning."""
var quote: String =
" Posted by Frederic Brussat on July 3, 2020
Share
Literary Wisdom

Hope is a renewable option: If you run out of it at the end of the day, you get to start over in the morning."



Previous                                                    Next                                                    Home

No comments:

Post a Comment