palindrome function java
package test
//The function below checks if a string is a palindrome
//True = Is a palindrome & False = Not a palindrome
public boolean isPalindromString(String text){
String reverse = reverse(text);
if(text.equals(reverse))
{
return true;
}
return false;
}
//This function returns the reverse String of its input.
//Ex. if given "hello", it will return "olleh"
public String reverse(String input)
{
if(input == null || input.isEmpty())
{
return input;
}
return input.charAt(input.length()- 1) + reverse(input.substring(0, input.length() - 1));
}
Also in Java:
- récupérer les données d un liste java
- how to make an arraylist java
- in java how to convert string to integer
- rock paper scissors java
- read lines of file randomly java
- changing double space to single in java script
- java gateway process exited before sending its port number pyspark anaconda
- java hashmap get value
- how to create a constructor in java
- testing the web layer without authentication spring
- how to print to console in java
- html top padding
- how to compare string in java
- java jagged array days and months
- java get location of jar file
- java output length of each line in a text document
- java output array lists to file
- java read file text
- how to select a element in an arraylist java
- how to print to the console in java
- 2d array java
- how to make a loop in java
- imagesbutton how to set background
- spigot repeating task