July 2011
Intermediate to advanced
400 pages
8h 46m
English

I’ve made use of strings in many of my programs so far. In fact, a string was featured in the very first program in the book. Here it is again:
puts 'hello world'
Although that first program used a string enclosed within single quotes, my second program used a string in double quotes:
print('Enter your name: ' )
name = gets()
puts( "Hello #{name}" )Double-quoted strings do more work than single-quoted strings. In particular, they have the ability to evaluate bits of themselves as though they were programming code. To have something evaluated, you need to place it between a pair of curly brackets preceded by a hash mark ...
Read now
Unlock full access