Reputation: 190959
I have this code to reveres the words in a sentence.
using System;
class Code
{
public static void Main()
{
string x = "I am Sam";
foreach(var a in x.Split().Reverse())
{
Console.WriteLine(a);
}
}
}
When I compile this code (mono 2.10), I got error CS1501: No overload for method
Reverse' takes 0' arguments
error message.
What's wrong with the code?
Upvotes: 1
Views: 4447