Search
 
SCRIPT & CODE EXAMPLE
 

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"
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript hide element by class 
Javascript :: sleep for 1 second 
Javascript :: javascript sleep for 1 second 
Javascript :: javascript uppercase first letter 
Javascript :: reactjs .htaccess 
Javascript :: add site url validation regex 
Javascript :: JS Fetch API Post Request 
Javascript :: remove all options from select jquery 
Javascript :: counter up cdn 
Javascript :: jquery before form submit 
Javascript :: regex for number and letters 
Javascript :: react navigation no header 
Javascript :: onclick for dynamically created element jquery 
Javascript :: vue pdf vue jest 
Javascript :: install latest npm for react 
Javascript :: node-fetch post request example 
Javascript :: on keyup jquery 
Javascript :: react native navigation transparent header 
Javascript :: onclick javascript confirm 
Javascript :: javascript roman to integer 
Javascript :: if array is empty jquery 
Javascript :: get last day of month typescript 
Javascript :: textarea react native 
Javascript :: JS get random number between 
Javascript :: sort array by date moment 
Javascript :: check comma in string javascript 
Javascript :: socket io with cors 
Javascript :: open link in new tab jquery 
Javascript :: synchronous ajax 
Javascript :: update react app 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =