Remove First and Last Character

Lee·2022년 6월 13일

Algorithm

목록 보기
14/92
post-thumbnail

❓ Remove First and Last Character

Q. It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the original string. You don't have to worry with strings with less than two characters.

✔ Solution

function removeChar(str) {
  //You got this!
  return str.slice(1, str.length - 1);
}

//ello my frien

Check

profile
Lee

0개의 댓글