How can I validate regex for full name? I only want alphabets (no numericals) and only spaces for the regex. This is what I have done so far. Would you please help me fix th
public static boolean isFullname(String str) { return str.matches("^[a-zA-z ]*$"); }
this method returns true if the string only contains alphabets and spaces.
But it also return true if the string contains nothing.