- Remove API_TESTING_SUMMARY.md, IMPLEMENTATION_SUMMARY.md - Remove MIGRATION_PROGRESS.md, SECURITY_*.md files - Clean up temporary documentation files from previous sessions - Repository now focused on current working code
17 lines
361 B
Go
17 lines
361 B
Go
package utils
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
// NormalizeISBN removes hyphens and spaces from ISBN to standardize format
|
|
// Handles ISBN-10 and ISBN-13 formats
|
|
func NormalizeISBN(isbn string) string {
|
|
if isbn == "" {
|
|
return ""
|
|
}
|
|
|
|
// Remove hyphens and spaces, return only digits and X (for ISBN-10)
|
|
return regexp.MustCompile(`[-\s]`).ReplaceAllString(isbn, "")
|
|
}
|