How to check if ISBN format is valid?

Question is
Do simple validation of data entered into a Book; for example, accept ISBNs only of the form n-n-n-x where n is an integer and x is a digit or a letter. Store an ISBN as a string.

Is there anyway to take a string and put it into the input stream? I guess the checking will be easy then.

I've recently done that for an assignement. What you wanna do is to get each of the Block of Numbers (separated by -) and check certain things on those 'Blocks'. Or you could go character by character, but first method is most efficient.

https://en.wikipedia.org/wiki/International_Standard_Book_Number (This page helped me alot do to the function)

Good luck and keep posting if you need help !
Topic archived. No new replies allowed.