Hi,
is there any Ruby equivalent to:
php:
$var = <<<END
sometext
sometext
sometext
END;
so I can write multiline in a single variable ?
Regards.
Hi,
is there any Ruby equivalent to:
php:
$var = <<<END
sometext
sometext
sometext
END;
so I can write multiline in a single variable ?
Regards.
On 06/11/06, Googled [email protected] wrote:
sometext
END;so I can write multiline in a single variable ?
Regards.
Almost the same syntax:
irb(main):001:0> var =<<END
irb(main):002:0" sometext
irb(main):003:0" sometext
irb(main):004:0" sometext
irb(main):005:0" END
=> " sometext\n sometext\n
sometext\n"
Farrel
Thank you very much
there are small variations on the theme:
<<identifier - interpolated, goes until identifier
<<“identifier” - same thing
<<‘identifier’ - no interpolation
<<-identifier - you can indent the identifier by using “-” in front
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs