About 170,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 …

  2. 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), …

  3. 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.

  4. 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, 9 months ago Modified 2 months ago Viewed 249k times

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

  6. python - Split Strings into words with multiple word boundary ...

    734 re.split () re.split (pattern, string [, maxsplit=0]) Split string by the occurrences of pattern. If capturing parentheses are used in pattern, then the text of all groups in the pattern are also …

  7. Splitting on last delimiter in Python string? - Stack Overflow

    Both methods start splitting from the right-hand-side of the string; by giving str.rsplit() a maximum as the second argument, you get to split just the right-hand-most occurrences.

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

    Split string on whitespace in Python [duplicate] Asked 13 years, 11 months ago Modified 3 years, 3 months ago Viewed 1.2m times

  9. Using Python to break a continuous string into components?

    Sep 2, 2011 · This is my typical "string" 00000000110000000000011000000000 I need to break it up into four equal parts: 00000000 11000000 00000110 00000000 I need to append the list to …

  10. 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 …