New to ruby, how would I get the file extension from a url like:
http://www.example.com/asdf123.gif
Also, how would I format this string, in c#
Use File.extname
File.extname("test.rb") #=> ".rb" File.extname("a/b/d/test.rb") #=> ".rb" File.extname("test") #=> "" File.extname(".profile") #=> ""
To format the string
"http://www.example.com/%s.%s" % [filename, extension]