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
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
javascript split text after x characters
// =======( /.{4}/g ) Replace number 4 number the any the number for cout the char
// this will add space after each charactar
// ========= (index % 40 == 36 ? '\n' : ' ') spose you have 100 characater thrn
//this line will add new line after each 40 character..
var replaced = str.replace(/.{4}/g, function (value, index) {
return value + (index % 40 == 36 ? '\n' : ' ');
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us