I have the following C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
char[] st = "stackoverflow".ToCharArray();
char[] ca = { 's', 't', 'a', 'c', 'k' };
if (st.Take(5) == ca)
{
Console.WriteLine("Success");
}
else
{
Console.WriteLine("Failure");
}
}
}
}
It's intended to write "Success" to the console but it always prints "Failure". Any help would be really appreciated.