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
csharp 3.0
var str = "This is a end, my only friend!";
str = String.Join(" ", str.Split().Reverse().ToArray());
Console.WriteLine(str);
ExpandDiskEdit
fantom
"This is a end, my only friend!".split.reverse.join(" ")

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