diff --git a/.gitignore b/.gitignore index b83d222..35c0274 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ /target/ +<<<<<<< HEAD +======= +*.xml +>>>>>>> 6e8f63e2c0b4f89a6f46070511e8ce4223af4bb7 diff --git a/src/main/java/com/mycompany/bibliotheque/Contrôle/LivreValide.java b/src/main/java/com/mycompany/bibliotheque/Contrôle/LivreValide.java index 23a50d3..812188d 100644 --- a/src/main/java/com/mycompany/bibliotheque/Contrôle/LivreValide.java +++ b/src/main/java/com/mycompany/bibliotheque/Contrôle/LivreValide.java @@ -12,13 +12,37 @@ public class LivreValide { // 1. ISBN : exactement 13 chiffres public static boolean isValidIsbn(String isbn) { // TODO Emile: implémenter la validation - return false; + + boolean valide = true; + if(isbn.length() == 13){ + int i = 0; + while (i < 13 && valide) { + if(!Character.isDigit(isbn.charAt(i))){ + valide = false; + }else{ + i++; + } + } + }else{ + valide = false; + } + return valide; + } // 2. Titre : pas de balises HTML/JS (