Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
 
PREVIOUS NEXT
Tagged: #split #string #parts #javascript
ADD COMMENT
Topic
Name
8+3 =