Skip to content

Instantly share code, notes, and snippets.

@baaratik93
Last active February 13, 2023 11:02
Show Gist options
  • Save baaratik93/b2f44e92ca3f5b090c795fa4915dc20f to your computer and use it in GitHub Desktop.
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.
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
@baaratik93
Copy link
Author

Envoyez-moi vos suggestions!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment