And one more version :) :
public static class Reverser {
public class Word {
public int Index { get; set; }
public string TheWord { get; set; }
}
public static string DoTheJob(string sentence) {
int counter = 0;
string result;
var query = from word in sentence.Split(' ')
select new Word {
Index = counter++,
TheWord = word
};
result = string.Join(" ", query.OrderByDescending(i => i.Index).Select(i => i.TheWord).ToArray<object>());
return result;
}
}
The usage:
Reverser.DoTheJob("Some string in here");
And the output
here in string Some