Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: delete document mongoose 
Javascript :: get an element from outside of iframe jquery 
Javascript :: how to add eslint to react project 
Javascript :: form data 
Javascript :: javascript object get value by key in array 
Javascript :: ipcrenderer main.js 
Javascript :: localstorage in js 
Javascript :: javascript math absolute 
Javascript :: create new Next.js 
Javascript :: javascript allow default 
Javascript :: axios api post request 
Javascript :: javascript foreach break 
Javascript :: node get current user 
Javascript :: javascript promise example basic 
Javascript :: Select radio button through JQuery 
Javascript :: concat array javascript 
Javascript :: How to add Select2 on Dynamic element - jQuery 
Javascript :: javascript Set Intersection Operation 
Javascript :: js add item to array 
Javascript :: angular conditionally show tooltip 
Javascript :: javascript loop through array backwards 
Javascript :: convert a date into timestamp in javascript 
Javascript :: flatten nested object js 
Javascript :: jquery get custom attribute 
Javascript :: Odoo Plain Javascript files 
Javascript :: how to include js file in react 
Javascript :: emoji-picker-react 
Javascript :: Convertir Map a Json 
Javascript :: how to send response to client in nodejs using res object 
Javascript :: string match method 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =