26 lines
643 B
C#
26 lines
643 B
C#
namespace PalindromeExtention
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
string input = "otto";
|
|
Console.WriteLine(input.Palindrom());
|
|
}
|
|
}
|
|
static class PalindormExtention
|
|
{
|
|
public static bool Palindrom(this string input)
|
|
{
|
|
string index = input.Replace(" ","").ToLower();
|
|
for (int i = 0; i < index.Length / 2; i++)
|
|
{
|
|
if (index[i] != index[index.Length - i - 1])
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
} |