Multiple Line String Literal in Actionscript 3

Nick Sonneveld picture Nick Sonneveld · Jul 16, 2009 · Viewed 8.1k times · Source

How do you specify a multiple line string literal in Actionscript 3?

Note that this is sometimes called a here document, heredoc, hereis, multiline string, etc.

Answer

Nick Sonneveld picture Nick Sonneveld · Jul 16, 2009

There is one example from this site: Multi-line strings in Actionscript 3

Because actionscript is based on javascript, you can use the cdata tags.

private var myString:String = ( <![CDATA[

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Maecenas dui lacus, sollicitudin nec laoreet a, vestibulum a 
odio. Sed et lorem mauris, non porttitor ligula. Aliquam 
convallis dolor rutrum justo semper nec aliquet orci....

]]> ).toString();