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

c# - Move local mssql database to webhosted MYSQL -

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -