I want to print string in reverse format:
Input: My name is Archit Patel
Output: Patel Archit is name My
.
I\'ve tied the
public static string MethodExercise14Logic(string str)
{
string[] sentenceWords = str.Split(' ');
Array.Reverse(sentenceWords);
string newSentence = string.Join(" ", sentenceWords);
return newSentence;
}