Last active
February 13, 2023 11:02
-
-
Save baaratik93/b2f44e92ca3f5b090c795fa4915dc20f to your computer and use it in GitHub Desktop.
Une fonction qui récrée la méthode split de python. Elle reçoit une chaine de caractère et un séparateur puis renvoie une liste ou tableau de chaines de caratère.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def CustomSplit(ch,sep): | |
if ch[-1]==sep: | |
pass | |
else: | |
ch+=sep | |
ligne="" | |
std = [] | |
for i in ch: | |
if i != sep: | |
ligne+=i | |
else: | |
std.append(ligne) | |
ligne="" | |
continue | |
return std |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Envoyez-moi vos suggestions!!