The `split()` method splits a string based on the given substring and returns a `list`. By default, whitespace is used for splitting and empty elements are discarded. The `maxsplit` argument allows you to restrict the number of times the input string should be split. Use `rsplit()` if you want to split from right to left.
The `partition()` method will give a `tuple` of three elements — portion before the leftmost match, the separator itself and the portion after the split. You can use `rpartition()` to match the rightmost occurrence of the separator.
This video is based on content from my "100 Page Python Intro" ebook: https://github.com/learnbyexample/100...
Auf dieser Seite können Sie das Online-Video Python tip 25: split and partition string methods mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer learnbyexample 20 März 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 240 Mal angesehen und es wurde von 4 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!