我有一个If-else语句,它检查一个字符串以查看是否存在ISBN-10或ISBN-13 (图书ID)。我面临的问题是ISBN-10校验,它发生在ISBN-13校验之前,ISBN-10校验将匹配任何包含10个或更多字符的字符,因此可能会将ISBN-13误认为ISBN-10。 echo "ISBN-10 FOUND\n";
//isbn returned will b
ISBN-10 identifiers are ten digits long. The first nine characters are digits 0-9.An ISBN-10 number is valid if the sum of the digits multiplied by their position modulo 11
equals zero
这就是我正在读的文件:
An International Standard Book Number (ISBN) is a code of 10 characters, referred to as ISBNAn ISBN-10 consists of four parts: a group code, a publisher code,