Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Palindrome
- {
- public static void Main(string[] args)
- {
- Console.WriteLine(Palindrome.IsPalindrome("kék"));
- Console.ReadLine();
- }
- public static bool IsPalindrome(string word)
- {
- char[] input = word.ToLower().ToCharArray();
- char[] reverseWord = new char[input.Length];
- int j = 0;
- for (int i = input.Length - 1; i >= 0; i--)
- {
- reverseWord[j] = input[i];
- j++;
- }
- if (reverseWord == input)
- {
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement