currently having a major problem with whitespaces and it detects a whitespace only if the keyboard if pressed once and if you press it more than once it does not work. i have setup a do while loop to try and contain invalid data but its only working for characters and not white spaces...help would be greatly thanked.
/*if salesPersonName is null or just spaces then this
piece of code runs, displaus output and asks for input
which salespersoname = input 2
System.out.println("Sales person's name can not"
+ " be empty or have space, must contain "
+ "a-z characters");
System.out.println("Enter Sales Person Name;");
salesPersonName = input2.nextLine();
//keeps looping until input is not null or contains just spaces
} while (salesPersonName.matches("^[^a-z,^A-Z,\\s]$"));