About 171,000 results
Open links in new tab
  1. 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 delimiter, see …

  2. 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?.

  3. How to split by comma and strip white spaces in Python?

    This doesn't work well for your example string, but works nicely for a comma-space separated list. For your example string, you can combine the re.split power to split on regex patterns to get a "split-on …

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

    How do I split a string into a list of characters? str.split does not work.

  5. 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 RegexObject.split.

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

    In Python, how do I split a string and keep the separators? Asked 15 years, 10 months ago Modified 3 months ago Viewed 250k times

  7. python - How to split a dataframe string column into two columns ...

    Jan 15, 2018 · 1: If you're unsure what the first two parameters of .str.split() do, I recommend the docs for the plain Python version of the method. But how do you go from: a column containing two …

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

    Why you should NOT use split("\n") 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 …

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

    31 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 you in a …

  10. python - How do I split the definition of a long string over multiple ...

    See also: How can I do a line break (line continuation) in Python (split up a long line of source code)? when the overall line of code is long but doesn't contain a long string literal.