Programming Tutorials

URL encode a string in Ruby

By: Jeeva in Ruby Tutorials on 2009-03-03  

escape(string)

URL-encode a string.

  url_encoded_string = CGI::escape("'Stop!' said Fred")
     # => "%27Stop%21%27+said+Fred"





Add Comment

* Required information
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in Ruby )

Latest Articles (in Ruby)