Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get string after character javascript

const str = '01-01-2020';

// get everything after first dash
const slug = str.substring(str.indexOf('-') + 1); // 01-2020

// get everything after last dash 
const slug = str.split('-').pop(); // 2020
Comment

PREVIOUS NEXT
Code Example
Javascript :: Javascript measure function run time 
Javascript :: mongo atlas filter by array not empty 
Javascript :: change input to required jquery 
Javascript :: three js cdn 
Javascript :: regex check if number is even 
Javascript :: generate random hash in javascript 
Javascript :: javascript go to top of page 
Javascript :: javascript convert string to 2 decimal 
Javascript :: how to restart elasticsearch node 
Javascript :: javascript convert milliseconds to hh mm ss 
Javascript :: select2 destroy 
Javascript :: js wait 1 second 
Javascript :: javascript import jquery 
Javascript :: Error: It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. 
Javascript :: counterup2 cdn 
Javascript :: javascript remove spaces at the beginning of the end of the string 
Javascript :: javascript check for undefined 
Javascript :: react native duplicate resources: Android 
Javascript :: how to get last path from url in javascript 
Javascript :: remove apex chart toolbar 
Javascript :: use json file for data jquery 
Javascript :: js replace quotes 
Javascript :: upgrade node version ubuntu 
Javascript :: command to create react app 
Javascript :: javascript regex french phone number 
Javascript :: how to get value of button that click on it jquery 
Javascript :: href back page javascript 
Javascript :: how to set json type jquery ajax 
Javascript :: import map in angular 
Javascript :: DeprecationWarning: Mongoose: `findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` option set to false are deprecated. See: https://mongoosejs.com/docs/deprecations.html#findandmodify 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =