I’ve long been a double-quote user and thought it odd that languages supported both that and a single-quote for string literals. Ruby though is a bit clever. A single-quote e.g. ‘literal text’ tells Ruby not to waste time looking inside the string. Double-quotes e.g. “Hello {#name}” tells Ruby that you want it to interpret the contents. In this case Ruby will replace #name with the variable’s value.
Add New Comment
Viewing 2 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)