About 43,700 results
Open links in new tab
  1. Java way to check if a string is palindrome - Stack Overflow

    Aug 9, 2017 · If the string is made of no letters or just one letter, it is a palindrome. Otherwise, compare the first and last letters of the string. If the first and last letters differ, then the string is not a palindrome; Otherwise, the first and last letters are the same. Strip them from the string, and determine whether the string that remains is a ...

  2. java - Check string for palindrome - Stack Overflow

    You can check if a string is a palindrome by comparing it to the reverse of itself: public static boolean isPalindrome(String str) { return str.equals(new StringBuilder(str).reverse().toString()); }

  3. string - Palindrome in java - Stack Overflow

    Jan 23, 2022 · A palindrome is a word, sentence, verse, or even a number that reads the same forward and backward. In this java solution, we’ll see how to figure out whether the number or the string is palindrome in nature or not. Method - 1

  4. java - Creating a recursive method for Palindrome - Stack Overflow

    Jun 28, 2015 · I am trying to create a Palindrome program using recursion within Java but I am stuck, this is what I have so far: public static void main (String[] args){ System.out.println(isPalindrome("noon"...

  5. java - Palindrome Program - Stack Overflow

    Jan 30, 2014 · I'm trying to write a program which will output what Palindromes will work from entering in a string and how many there are. I keep getting a lot of errors and I'm still trying to get my head around some of the harder topics in Java! Here's what I have already, as always, all answers are greatly appreciated!

  6. Palindrome Program in java - Stack Overflow

    Mar 30, 2018 · Palindrome Program in java Hello, I have created a java program that is intended for outputting palindrome numbers whenever it prompts the end user to enter 2 numbers from a starting endpoint to a ending endpoint.

  7. java - The fastest method of determining if a string is a palindrome ...

    Jan 28, 2014 · I need an algorithm that verify with the fastest possible execution time, if a string is a palindrome ( the string can be a proposition with uppercase or lowercase letter, spaces etc.). All of this in Java. I got a sample :

  8. java 8 - Palindrome of int using lambda expression - Stack Overflow

    Apr 22, 2018 · If you have 10 digit number , you need to compare half of the way to know whether given number is palindrome or not. we are converting number to string then dividing the length by 2 , then comparing left side char with right side char (means 0th char should match with last char, same way for other index's, left to right char comparison ) as …

  9. java - How to check whether a string is palindrome or not

    Jul 22, 2016 · Im trying to code a palindrome. It has a user input string and the program will tell if it is a palindrome or not. I have searched the net for the code but it seems that when I have created another

  10. Palindrome tester with Java, ignoring spaces and punctuation

    Oct 13, 2009 · This looks like a really old post but I think I stumbled upon a simpler solution for a palindrome test. This checks the first and last characters and moves inwards and exits the program as soon as the characters do not match.

Refresh