What I do
str= " John Smith Beer "
str.tr(" ", "%20")
"%%John%%%Smith%Beer%"
It doesn't replace it with "%20". How to fix it?
What I do
str= " John Smith Beer "
str.tr(" ", "%20")
"%%John%%%Smith%Beer%"
It doesn't replace it with "%20". How to fix it?
require 'uri'
URI.encode("green books")
# => "green%20books"