Advertisement
KonstantyNil

Untitled

Feb 24th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. static void IsPalindrome(string palindrome)
  2.         {
  3.             string isPalindrome1 = string.Join("", palindrome.Split(default(string[]), StringSplitOptions.RemoveEmptyEntries)).ToLower();
  4.             Console.WriteLine(isPalindrome1);
  5.             char[] isPalindrome2 = isPalindrome1.ToCharArray();
  6.             Array.Reverse(isPalindrome2);
  7.             Console.WriteLine((isPalindrome1 == string.Join("", isPalindrome2) ? true : false));
  8.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement