Op 6-9-2020 om 10:07 schreef Steffen Märcker:
Maybe this is a naive question, but can you just split the task into the following two?
1. Check whether whether the string is syntactically an ISBN number. This can be done, e.g., using a regex.
2. Check the the check character. Calculate the check character from the (now to be known) syntactically valid string.
ISBNValidator>>isValidISBN: aString  ^(self isSyntacticallyValid: aString) and: [self isCheckCharacterValid: aString]
Kind regards, Steffen nder if the code will not be too big. I learned that it is good
Sorry to respond not earlier but your respons seems to be in the spam folder of my provider. I could do that but if very bad in regex so I do not know a regex which van validate 123456789 or 123-456-78-9 Roelof