Just like what the title says i have been trying to do this for hours.
System.out.print ("Please input the first name: ");
name1 = in.next();
if (name1.substring(0,1).equals("[a-zA-Z]"))
System.out.println("\t" + name1.substring(0,1).toUpperCase()+name1.substring(1).toLowerCase() + " is in the name list");
else if (name1.substring(0,1).equals("[0-9]"));
System.out.println("error");
This is part of the code that is not working out for me. I dont really know where i went wrong im a beginner at this. With this code whatever I write i get the second System.out.println back which is error. I want the program to display an error message if the string doesnt start with a number. Also, please use the if statement to do that because I couldn't use something I have not covered otherwise I would have searched it.