Problème avec un substring apparemment out of bounds mais je ne comprends pas pourquoi

Version imprimable