About 50 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 multi-line string into multiple lines ...

    How do I split a multi-line string into multiple lines? Asked 17 years, 4 months ago Modified 2 years, 5 months ago Viewed 573k times

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

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

    The algorithm behind split also seems to indicate whether your list begins/ends with a token or a separator: if starting with a separator it prepends an empty string as the first element. If ending with a …

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

  7. 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. If you'd like to …

  8. python - How to split a string based on either a colon or a hyphen ...

    Apr 17, 2015 · Are you trying to make a list of all elements seperated by either a '-' or ':'. Or just remove those characters from the string and return the new string sans thats character?

  9. How can I split and parse a string in Python? - Stack Overflow

    I am trying to split this string in python: 2.7.0_bf4fda703454 I want to split that string on the underscore _ so that I can use the value on the left side.

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

    736 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 returned as part of …