split has a special rule: when both the string and the separator are empty, the result is an empty array, so "".split("") has length 0. But with any other separator that is not found, split returns an array containing the original (empty) string, so "".split(",") is [""] with length 1. This asymmetry surprises many developers.