您好我有以下的代码,它给我的错误,回文(字符串)是一种方法,在给定的方法无效。一个函数,检查给定的单词是否回文
请帮助解决问题
namespace justtocheck
{
public class Program
{
public static bool Palindrome(string word)
{
string first = word.Substring(0, word.Length/2);
char[] arr = word.ToCharArray();
Array.Reverse(arr);
string temp = new string(arr);
string second = temp.Substring(0, temp.Length/2);
return first.Equals(second);
//throw new NotImplementedException("Waiting to be implemented.");
}
public static void Main(string[] args)
{
Console.WriteLine(Palindrome.IsPalindrome("Deleveled"));
}
}
}
有这个代码不'IsPalindrome()'方法。 – Claies
嗨,仍然显示一些错误,请参考testdome.com/questions/c-sharp/palindrome/7282?visibility=1 –
你不会学习如何编程,要求人们为你写代码测试问题的答案.... – Claies