我所做的
str= " John Smith Beer " str.tr(" ", "%20") "%%John%%%Smith%Beer%"
它不会用"%20"代替它.怎么解决?
require 'uri' URI.encode("green books") # => "green%20books"