tags:

views:

19

answers:

1

In YAML, I have a string that's very long. I want to keep this within the 80-column (or so) view of my editor, so I'd like to break the string. What's the syntax for this?

In other words, I have this:

Key: 'this is my very very very very very very long string'

and I'd like to have this (or something to this effect):

Key: 'this is my very very very ' +
     'long string'

I'd like to use quotes as above, so I don't need to escape anything within the string.

A: 
>
  This is a very long sentence
  that spans several lines in the YAML
  but which will be rendered as a string
  without carriage returns.

http://components.symfony-project.org/yaml/trunk/book/02-YAML#chapter_02_sub_strings

Matt Williamson
Thanks, but you can't wrap this syntax in quotes, it seems: the quotes appear as literals in the resulting string.
jjkparker
I don't think you add the quotes. The `>` infers it is a string.
Matt Williamson