Split String By Multiple Spaces NodeJS

javascript, node.js, string

Solution

Thank you for comments. It seems that quotes are not needed at all:

> out.split(/\s+/); 

Problem

I have this in node: ``` >out 'java 1303 root 187u CHR 166,0 0t0 14586 /dev/ttyACM0\n' >typeof out 'string' > out.split("\\s+"); [ 'java 1303 root 187u CHR 166,0 0t0 14586 /dev/ttyACM0\n' ] ``` I would expect the splitted string, e.g. ['java','1303','root'...]

Original source