Answers for "to check if a number is palindrome or not"

C++
2

check if a string is a palindrome

int length = myString.Length;
for (int i = 0; i < length / 2; i++)
{
    if (myString[i] != myString[length - i - 1])
        return false;
}
return true;
Posted by: Guest on October-30-2021
-1

check if palindrome

function isPalindrome(str) {
  str = str.toLowerCase();
  return str === str.split("").reverse().join("");
}
Posted by: Guest on August-17-2020

Code answers related to "to check if a number is palindrome or not"

Browse Popular Code Answers by Language