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

    Dec 4, 2016 · For example \n is a newline character inside a python string which will lose its meaning in a raw string and will simply mean backslash followed by n. string.split() string.split() …

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

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

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

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

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

  8. python - Dividing a string at various punctuation marks using split ...

    Mar 21, 2012 · I'm trying to divide a string into words, removing spaces and punctuation marks. I tried using the split () method, passing all the punctuation at once, but my results were …

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

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