Skip to tool

Python str.split() Online

Split by delimiter.

The output updates as you type. The tool processes input in your browser.

Worked example

Provide a literal separator. Preserve empty fields if adjacent separators represent missing values.

Delimiter
","
Maximum splits (-1 for all)
-1
Sample input
a,b,c,d
Sample output
[
  "a",
  "b",
  "c",
  "d"
]

Using this operation in Python

The interactive result uses JavaScript. Python str stores Unicode text. Encode to bytes when an API expects UTF-8 or another byte representation.

Python reference