Here Documents by number marker : Here Document « String « Ruby






Here Documents by number marker


A here document allows you to build strings from multiple lines on the fly
A here document preserves newlines. 
A here document is formed with a << and a delimiting character or string of your choice. 

sonnet = <<29
W
I
A
A
W
F
D
W
Y
29

puts sonnet

 








Related examples in the same category

1.HERE documents give you a shortcut for printing multiple lines to the console window
2.Use EOF as the marker for a here document