reactjs cut part of string
var str = "Hello world!"; var res = str.substring(1, 4); // res value is "ell"
Source: stackoverflow.com
get substring from right to left javascript
let word = "Subscribe to Crosby Roads on YouTube!" // From the right show 24 characters let subResult = word.substr(word.length - 24) console.log(subResult) // Crosby Roads on YouTube!
get substring from right to left javascript
let word = "Subscribe to Crosby Roads on YouTube!" // From the right show 24 characters let subResult = word.substr(-24) console.log(subResult) // Crosby Roads on YouTube!
Source: youtube.com