Interpolation with expression
- interpolation
- capitalize
Ruby allows us to include more complex expression in the interpolation, for exampl to call the capitalize
method of a string.
It is nice, but don't put anything complex in there!
person = 'foo'
puts "Hello #{person.capitalize}, how are you?"
Hello Foo, how are you?