How to check whether a string contains at least one alphabet in java?

You can use .*[a-zA-Z]+.* with String.matches() method.

boolean atleastOneAlpha = s.matches(".*[a-zA-Z]+.*");

Leave a Comment