Validating isbn 10 c advice dating sensible
The following function does just that: It removes all characters which are not allowed in a ISBN.
This makes use of Arrow-style function composition.
When the system calculate the check digit for 978168197271 it will come up with 8 as the check digit for that number.
It will compare 8 with 2 and know that a mistake of some sort has been made.
An ISBN-10 control digit is calculated by multiplying each digit with its one-based index and taking the remainder from the integer division by eleven.