Split string into two parts javascript Code Example
split string into two parts javascript
var someString = "A04.3 A new Code";
var index = someString.indexOf(" "); // Gets the first index where a space occours
var id = someString.substr(0, index); // Gets the first part
var text = someString.substr(index + 1); // Gets the text part
javascript divide string into two parts
var str = "How are you doing today?";
var res = str.split();