Default behaviour of split() is to act on any whitespace char, which includes ' ' and '\n'.
Attach a file by drag & drop or click to upload