This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Whether it's written in Ruby or another language, almost all software needs to work with text. Programming languages represent text in the form of strings. A string is just a series of text characters. All languages let you work with strings, but Ruby makes it especially convenient.
- A string is a series of text characters
- A string can be surrounded by single or double-quotes.
'A string'
"Also a string"
- Almost all characters within string surrounded by single quotes appear as they are typed:
puts 'I #{represent} "characters" verbatim.'
- Some punctuation marks within double-quoted strings are interpreted specially:
puts "I make some substitutions: #{2 + 4}"
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up