I didn\'t get an optimized regex that split me a String basing into the first white space occurrence:
var str=\"72 tocirah sneab\";
I need
I needed a slightly different result.
I wanted the first word, and what ever came after it - even if it was blank.
str.substr(0, text.indexOf(' ') == -1 ? text.length : text.indexOf(' '));
str.substr(text.indexOf(' ') == -1 ? text.length : text.indexOf(' ') + 1);
so if the input is oneword you get oneword and ''.
If the input is one word and some more you get one and word and some more.