Skip to content

Instantly share code, notes, and snippets.

@mkoby
Created March 16, 2012 20:35
Show Gist options
  • Select an option

  • Save mkoby/2052497 to your computer and use it in GitHub Desktop.

Select an option

Save mkoby/2052497 to your computer and use it in GitHub Desktop.
Intro to Ruby - 02 - The String Addendum
# Double Quotes
double_quotes = "Here be double quotes"
# Single Quotes
single_quotes = 'Here be single quotes'
# Intermixing Quotes
'Sam said, "Never give up, never surrender"'
"Sam told me to read the book, 'Brave New World'"
# Single Quotes can't do contractions
"single quotes can't do contractions"
#Escaping Quotes
"I just got back from seeing the movie, \"Back to the Future\"" # notice the \" for double quotes, use \' for single quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment