string = "It was the best of times,\n\ It was the worst of times."
It is not the same as
string = "It was the best of times,\n\ It was the worst of times."
Same problem is displayed in ruby koans:
long_string = %{ It was the best of times, It was the worst of times. }
There are times when this is extremely inconvenient, and your style can only be saved by using templates as in:
require "erb" #test.erb: # hubba # hubba <%= oink %> erb = ERB.new(File.read("test.erb")) oink = "hubba" puts erb.result
No comments:
Post a Comment