From: Calvin Bornhofen Date: 2013-01-21T05:29:10+09:00 Subject: Re: question about string concatenation Hello, the thing you are puzzled about happens because you did not tell Ruby what you want to do with the string "[". You just placed a number after it (the error message should have told you, that the parser encountered a "tInteger" (your 9), but was expecting $end (what means that something ending the line would be appropriate). Did your confusion come from string interpolation? It looks somewhat similar to what you wrote; it would look something like "[#{9.to_s}]", where the to_s is fully optional, since everything in between the { and } will be converted to a string. Regards, Calvin On 20.01.2013 21:08, David Richards wrote: > I'm puzzled about why the following happens (I'm using v1.9.3): > > s = "[" 9.to_s "]" # error