String.split() Playground

Mrs. Endang’s letter board: the separators netted, the pieces numbered by their index, from the real split. What does an empty string give, and what does a…

Why it matters

split reads CSV, breaks up input, paths and URLs, takes a file extension. Misread the empty string or a separator at an edge, and empty elements sneak in as the "why is there an empty string in my array" bug.

The key idea

split throws the separator away and keeps everything between, empty pieces too

Try it in this playground