Le 6/4/2005, "Robert Klemme" <bob.news@gmx.net> a écrit:
>"Vraj Mohan" <vrajmohan@comcast.net> schrieb im Newsbeitrag
>news:42540521.7030801@comcast.net...
>> Will using Kernel#sprintf work achieve the same thing?
>> --Vraj Mohan
>>
>
>No.
Problem is that interpolation is done at the time the String
is first encountered, which may complicate things since the
variable used for substitution may not be available, if I am
understanding correctly.
However, this works in those in situations:
# file-one
str = "Inserted %s."
# file-two
require 'file-one'
puts str % 'this from file two'
> robert
E
No-one expects the Solaris POSIX implementation!