On Tue, Jan 31, 2012 at 6:00 AM, Lucky Nl <lakshmi27.u / gmail.com> wrote:

> In ruby we have the concpet "heredoc" to handle multiple line strings
>
>
> We can handle that with doublequotes
> for example
> x = "Grocery list
> ------------
>    1. Salad mix.
>    2. Strawberries.
>    3. Cereal.
>    4. Milk.
>       "
>
> puts x
>
> OUTPUT:
> Grocery list
> ------------
>    1. Salad mix.
>    2. Strawberries.
>    3. Cereal.
>    4. Milk.
>
> Anyspecific reason to use heredoc concept
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
It's great if you want to copy and paste some text. The text might have
single and double quotes in it, but with a heredoc that doesn't matter.
Otherwise, you'd have to go through your document, find all the quotes, and
escape them.