+ Start a Discussion
mikebzmikebz 

multi-line string

is there a way to do a multi line string in Apex Code?

 

This is an example from PHP (http://php.net/manual/en/language.types.string.php)

 

$str = <<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

sfdcfoxsfdcfox

Nope. You'll have to it the old-fashioned way:

 

string x = 'This is line one.\n'+
    'This is line two.\n'+
    'This is line three.';