Formatted UnicodeLetterChecker.java

This commit is contained in:
anujgaud 2023-10-30 13:50:16 +05:30 committed by GitHub
parent e99ce4da19
commit dfd9baf8e0
1 changed files with 4 additions and 1 deletions

View File

@ -13,15 +13,18 @@ public class UnicodeLetterChecker {
}
return true;
}
public boolean regexCheck(String input) {
Pattern pattern = Pattern.compile("^\\p{L}+$");
Matcher matcher = pattern.matcher(input);
return matcher.matches();
}
public boolean isAlphaCheck(String input) {
return StringUtils.isAlpha(input);
}
public boolean StreamsCheck(String input){
public boolean StreamsCheck(String input) {
return input.codePoints().allMatch(Character::isLetter);
}
}