Bonjour,
J'ai une fonction :
toto = 'xxxxxabcd'
Je cherche (sans succès) une fonction Python pour supprimer un certain nombre de caractère (fixe) au début de ma chaine pour obtenir :
toto = 'abcd'
Merci d'avance,
Xavier
Bonjour,
J'ai une fonction :
toto = 'xxxxxabcd'
Je cherche (sans succès) une fonction Python pour supprimer un certain nombre de caractère (fixe) au début de ma chaine pour obtenir :
toto = 'abcd'
Merci d'avance,
Xavier
Salut,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 In [157]: toto = "xxxabcd" In [158]: toto[3:] Out[158]: 'abcd' In [159]: toto = "xxxxxxxabcdxxxx" In [160]: toto[7:-4] Out[160]: 'abcd' In [161]: toto[7:11] Out[161]: 'abcd'
Partager