Last week we had a quick look at Strings in Ruby. Now let’s look at some more advanced sting operations.
Strings in Ruby
Ruby has many ways of making strings, which are generally variations of the many ways Perl has of making strings. Double quotes allow values to be interpolated into the string, while single quotes do not. Most escapes are treated literally in single quotes, including the fact that \n
is treated as two characters, a backward slash followed by an n.
Oh, I Meant Objects
Here is a more honest version of the last Ruby example. Ruby is a fairly pure object-oriented language, which borrows a good bit from Smalltalk. Pretty much everything is an “object”.
Ruby Expressions
This is the first in a series for beginners on the Ruby Programming Language. Note that Ruby is a programming language. Ruby on Rails (“RoR”) is a web-application framework that is implemented in Ruby. Do not confuse the two. We will not covering Ruby on Rails in these tutorials.
These tutorials will be gather together under the tag #RubyTuesday, as we will be posting one each week from today to the end of term. Ready? Here we go…