String concatenation in Ruby

I am looking for a more elegant way of concatenating strings in Ruby.

I have the following line:

source = "#{ROOT_DIR}/" << project << "/App.config"

Is there a nicer way of doing this?

And for that matter what is the difference between << and +?

16 Answers
16

Leave a Comment