Answers for "substr in"

5

substr

const str = 'substr';

console.log(str.substr(1, 2)); // (1, 2): ub
console.log(str.substr(1)); // (1): ubstr

/* Percorrendo de trás para frente */
console.log(str.substr(-3, 2)); // (-3, 2): st
console.log(str.substr(-3)); // (-3): str
Posted by: Guest on September-18-2020
2

substr

str.substr(start[, length])
Posted by: Guest on February-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language