Hi *,

I like to concatenate a string out of some variables, some of which
are nil. Instead of getting always a "can't convert nil into String
(TypeError)" message, I would like to have "nil" appended to my
string, as in Java null objects are printed as null in Strings.
Something like this:

words = Hash.new
words[0]="one"
allWords = "all words:"
allWords << words[0]
allWords << words[1]
# --> can't convert nil into String (TypeError)

Is this possible? Or how can I handle nil objects for this case?

Thanks.