Source: https://dept-info.labri.fr/ENSEIGNEMENT/programmation1/cours/CM_3___Tableaux_et_chaines_de_caracteres.pdf