ruby - Problems with replacing into string -



ruby - Problems with replacing into string -

i'm trying execute code this:

template = " ... here html tags [sitename] ... here html tags " template = template.gsub(/\[sitename\]/,"http://google.com")

but it's not working. mistake?

can describe how it's not working?

in ruby 1.9.2 expected, command

puts template

gives

... here html tags http://google.com ... here html tags

ruby gsub

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -