>>>>> "G" == George Moschovitis <gmosx / image.ece.ntua.gr> writes:

G> b. which is faster ?

 This is not the same

G> 1. a = 'value1 = ' + value1 + ' value2 = ' + value2

 You use the method #+ which can be redefined

G> 2. b = 'value1 = #{value1} value2 = #{value2}' ?

 Here I suppose that you want use "" rather than '', no ?


pigeon% cat b.rb
#!/usr/bin/ruby
class A
   def to_str
      "to_str"
   end
   def to_s
      "to_s"
   end
end

val = A.new
a = 'val = ' + val
b = "val = #{val}"
p a, b
pigeon% 

pigeon% b.rb
"val = to_str"
"val = to_s"
pigeon% 



Guy Decoux