Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

split string with the first space occurs JavaScript

var str="72 tocirah sneab";
str.substring(0, str.indexOf(' ')); // "72"
str.substring(str.indexOf(' ') + 1); // "tocirah sneab"
 
PREVIOUS NEXT
Tagged: #split #string #space #occurs #JavaScript
ADD COMMENT
Topic
Name
3+1 =