Replaced replace with gsub

I replaced the replace method with gsub so it matches the String class.