Question - How to write multiline string in Ruby.
Answer -
Writing multiline string is very simple in Ruby language. We will show three ways to print multiline string.
- String can be written within double quotes.
- The % character is used and string is enclosed within / character.
- In heredoc syntax, we use << and string is enclosed within word STRING.