From: Douglas Livingstone Date: 2005-04-23T22:14:06+09:00 Subject: Re: Clean way to dynamically expand string with "#{expression}"? On 4/23/05, dm1 wrote: > > > > Many interpolation code, including mine and several people > > suggested will break if '"' or certain string is contained > > in string to interpolate. > > > > Practically, it doesn't need to be perfect, but it was my > > technical interest that there may be better way to do it. > > Above code is cleaner and more robust, so I'll go with it. > > Thanks for the pointer. > > > > I do share that technical interest. I really wonder if there is a one liner > for 'perfect interpolation on demand'. Everything i can think of is a bit > longer. Let the quest continue :) > The perfection might look something like this: "string with #{data}" == 'string with #{data}'.interpolate "abc" would just be syntax sugar for 'abc'.interpolate I don't know how to express that in ruby though :( Douglas