Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to check that letter is not a number and is repeating or not in a sentence in java

private static boolean check(String input) {
    for (int i = 0; i < input.length(); i++) {
        char ch = input.charAt(i);
        if (Character.isLetter(ch) && input.indexOf(ch, i + 1) != -1) {
            return true;
        }
    }
    return false;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #letter #number #repeating #sentence #java
ADD COMMENT
Topic
Name
5+5 =