View Problem

Reverse the words in a string

Given the string "This is a end, my only friend!", produce the string "friend! only my end, the is This"
ExpandDiskEdit
ruby
reversed = text.split.reverse.join(' ')
ExpandDiskEdit
erlang
Reversed = string:join(lists:reverse(string:tokens("This is the end, my only friend!", " ")), " "),
DiskEdit
clojure
(require '[clojure.contrib.str-utils2 :as str])
(str/join " " (reverse (str/split "this is the end, my only friend!" #" ")))
DiskEdit
clojure
(apply str (interpose " " (reverse (re-seq #"[^\s]+" "This is the end, my only friend!"))))

Submit a new solution for ruby, erlang, or clojure
There are 23 other solutions in additional languages (cpp, csharp, fantom, fsharp ...)