📅  最后修改于: 2022-03-11 14:48:15.943000             🧑  作者: 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));
}
}