Could anyone tell me how to write palindromes function in Java without using String API's? Is there any inbuilt function in Java API
Asked
Active
Viewed 240 times
0
-
You can use a stringbuilder to reverse the string and compare it with itself. But a) your question is unclear (do you need a palindrome test or a generator? b) you should show some tentative before asking. – Diego Martinoia Sep 21 '15 at 12:46
-
your answer is here [Click here](http://stackoverflow.com/questions/8444710/easiest-way-to-check-if-a-string-is-palindrome) – Parth Solanki Sep 21 '15 at 12:47
-
There is no such function that comes with Java itself. The check can be written with a few lines of code though. Or you can find it with google. – f1sh Sep 21 '15 at 12:47
-
Let me try with apache-commons-palindrome – Arvind Chavhan Sep 21 '15 at 12:52
-
Thanks subodh Joshi. It works. Thank you so much. – Arvind Chavhan Sep 21 '15 at 12:54
1 Answers
1
You could use recursive function also if you do like to do in core logic. Here is the example for you. Have a look if beneficial to you.

Pravin Chavhan
- 36
- 3