From: Alex Gutteridge Date: 2012-08-15T22:49:35+09:00 Subject: Re: Variable in string in array On 15.08.2012 13:46, Dave Castellano wrote: > Anybody know how to embed a #{} in a string and then place the string > in > an array? > > eg. > > array =["An #{age} year old..."] > > returns > > /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15 > > I tried adding single quotes > array =[' "An #{age} year old..." '] and this accepted the string > but > the variable was also converted to a string, so lost as a variable. > > Thanks The code snippet you post is correct, so whatever exception TextMate is catching has been thrown from somewhere else: >> age = 99 => 99 >> array =["A #{age} year old..."] => ["A 99 year old..."] -- Alex Gutteridge