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 :: moment format heure 
Javascript :: export app react native 
Javascript :: javascript get smaller of two numbers 
Javascript :: javascript deconstruct object 
Javascript :: jquery templates 
Javascript :: nextjs react native web typescript 
Javascript :: Reusable Alpine.js components 
Javascript :: buffer to image nodejs 
Javascript :: buffer nodejs 
Javascript :: socket.io cdn 
Javascript :: convert string to lowercase javascript 
Javascript :: sum of all elements in array javascript 
Javascript :: array list in javascript 
Javascript :: usb react native device not found 
Javascript :: jquery selectors attribute ends with 
Javascript :: discord button 
Javascript :: javascript array clear 
Javascript :: how to sho the active navigation ling using javascript 
Javascript :: angular tab change smooth transition 
Javascript :: js array split by comma 
Javascript :: assign input text value jquery 
Javascript :: moment all formats in reactjs 
Javascript :: javascript kill all childs 
Javascript :: powershell script string show variable 
Javascript :: vuex store watch 
Javascript :: clear timeout in function js 
Javascript :: expo font 
Javascript :: how to get data-target value in jquery 
Javascript :: DevDependencies and dependencies syntax in Node package.json 
Javascript :: glide.js autoplay 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =