Split string on the first white space occurrence

后端 未结 13 2017
孤街浪徒
孤街浪徒 2020-11-28 20:07

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

13条回答
  •  感情败类
    2020-11-28 21:03

    In ES6 you can also

    let [first, ...second] = str.split(" ")
    second = second.join(" ")
    

提交回复
热议问题