0

Is there a way to split a string into 2 words using space as a delimiter? I know there is split(" ") but it is splitting it by one word. I want something like

var at = "this is not the end of the world boo";

at.somefunc(" ", 2)//returns ["this is", "not the", "end of", "the world", "boo"]
gerl
  • 1,161
  • 2
  • 17
  • 53
  • 4
    Asked and answered. Try a bit more research next time http://stackoverflow.com/questions/19782547/split-string-based-on-second-occurrence-of-delimiter-using-javascript – CollinD Oct 23 '15 at 19:01
  • Not just that one @CollinD http://stackoverflow.com/questions/20947308/javascript-split-string-on-every-other-symbol now which one link merits the duplicate flag? – AGE Oct 23 '15 at 19:08

0 Answers0