About 6,900,000 results
Open links in new tab
  1. How does Python split() function works - Stack Overflow

    Dec 4, 2016 · Raw string vs Python string r'","' The r is to indicate it's a raw string. How is a raw string different to a regular python string? The special characters lose their special meaning …

  2. Split a string by a delimiter in Python - Stack Overflow

    To split on whitespace, see How do I split a string into a list of words?. To extract everything before the first delimiter, see Splitting on first occurrence. To extract everything before the last …

  3. python - How do I split a string into a list of words? - Stack Overflow

    To split on other delimiters, see Split a string by a delimiter in python. To split into individual characters, see How do I split a string into a list of characters?.

  4. python - How do I split a string into a list of characters? - Stack ...

    In Python, strings are already arrays of characters for all purposes except replacement. You can slice them, reference or look up items by index, etc.

  5. Most efficient way to split strings in Python - Stack Overflow

    Mar 7, 2012 · My current Python project will require a lot of string splitting to process incoming packages. Since I will be running it on a pretty slow system, I was wondering what the most …

  6. split () vs rsplit () in Python - Stack Overflow

    Dec 13, 2022 · The difference between split and rsplit is pronounced only if the maxsplit parameter is given. In this case the function split returns at most maxsplit splits from the left …

  7. In Python, how do I split a string and keep the separators?

    Great. If you want alternating tokens and separators, as you usually do, it would of course be better to use \W+. The algorithm behind split also seems to indicate whether your list …

  8. Split string with multiple delimiters in Python - Stack Overflow

    return re.split(regex_pattern, string, maxsplit) If you're going to split often using the same delimiters, compile your regular expression beforehand like described and use …

  9. python - How do I split a multi-line string into multiple lines ...

    Using split creates very confusing bugs when sharing files across operating systems. \n in Python represents a Unix line-break (ASCII decimal code 10), independently of the OS where you run it.

  10. regex - Split string on whitespace in Python - Stack Overflow

    Using split() will be the most Pythonic way of splitting on a string. It's also useful to remember that if you use split() on a string that does not have a whitespace then that string will be returned to …