📅  最后修改于: 2022-03-11 14:52:05.360000             🧑  作者: Mango
class IsAlpha
{
public static boolean isAlpha(String s) {
return s != null && s.matches("^[a-zA-Z]*$");
}
public static void main(String[] args)
{
String s = "ABCD";
System.out.println("IsAlpha: " + isAlpha(s));
}
}