Split the first separator of string.
$ npm install split-first
require("split-first");
console.log("192.168.0.1".splitFirst("."));
//=> [ '192', '168.0.1' ]
console.log("http://www.abc.com/example/demo/web.html".splitFirst("/"));
//=> [ 'http:', '/www.abc.com/example/demo/web.html' ]
console.log("tommy@email.com".splitFirst("#")); //not found
//=> [ 'tommy@email.com' ]
This code is licensed under the MIT License.