DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
devendradhanal profile image
Devendra Dhanal
const stringTrimmer = input => input.length <=2 ? null : input.substring(1, input.length - 1)



console.log(stringTrimmer("Lorem Ipsum")) // orem Ipsu
console.log(stringTrimmer("John Doe")) // ohn Do
console.log(stringTrimmer("Fox jumps over")) // ox jumps ove
console.log(stringTrimmer("Lorem")) // ore
console.log(stringTrimmer("Lo")) // null
Forem Open with the Forem app