Skip to content

Instantly share code, notes, and snippets.

@wycats
Created July 4, 2016 02:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wycats/5baf3d411cc121a9b8446b64cf9d2487 to your computer and use it in GitHub Desktop.
Save wycats/5baf3d411cc121a9b8446b64cf9d2487 to your computer and use it in GitHub Desktop.
https://repl.it/C82p/0 created by wycats
poem =
"My honeydew has flown from my hand
And my toast has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
"
p poem.lines
p poem.lines.map(&:chomp)
p poem.lines
p poem
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
>>> ["My honeydew has flown from my hand\n", "And my toast has gone to the\n", " moon.\n", "But when I saw it on television,\n", "Planting our flag on Halley's\n", " comet,\n", "More still did I want to eat it.\n"]
["My honeydew has flown from my hand", "And my toast has gone to the", " moon.", "But when I saw it on television,", "Planting our flag on Halley's", " comet,", "More still did I want to eat it."]
["My honeydew has flown from my hand\n", "And my toast has gone to the\n", " moon.\n", "But when I saw it on television,\n", "Planting our flag on Halley's\n", " comet,\n", "More still did I want to eat it.\n"]
"My honeydew has flown from my hand\nAnd my toast has gone to the\n moon.\nBut when I saw it on television,\nPlanting our flag on Halley's\n comet,\nMore still did I want to eat it.\n"
=> "My honeydew has flown from my hand\nAnd my toast has gone to the\n moon.\nBut when I saw it on television,\nPlanting our flag on Halley's\n comet,\nMore still did I want to eat it.\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment