XML uses paired angle brackets: : String Literal « String « Ruby






XML uses paired angle brackets:



puts %<<book><title>Ruby in a Nutshell</title></book>>  # This works

 








Related examples in the same category

1.Enclose strings in single quotes
2.Enclose strings in double quotes
3.mix single and double quotes, as long as Ruby can keep them straight
4.you cannot mix double-quoted text inside a double-quoted string, or single-quoted text inside a single-quoted string
5.Alternate single and double quotes
6.Escape quotation marks with a backslash
7.Make the print method skip to the next line without a HERE document, use the newline character, \n.
8.Three-line string literal