Validating for length of String
I am following the project requirements for our first java project at school. One of the requirements is to validate it so that STATE cannot be blank and must have no more than two letters (like CA for california)
I know how to validate for making sure the field is not blank but how about validating to make sure it is two characters long?
Thanks, so far I have a "Customer" class that creates a Customer constructor, setters, getters, and returns a summary. Now I'm working on the validation and I've validated Firstname, last, address to make sure the fields are not blank.
SOLVED the syntax is aCust.state.length != 2 where aCust is the object.