Remove the First and Last Characters

Published by Helen Yu in

Create a function that removes the first and last characters from a string.

Examples

removeFirstLast("hello") ➞ "ell"

removeFirstLast("maybe") ➞ "ayb"

removeFirstLast("benefit") ➞ "enefi"

Notes

N/A

Watch a quick demo on how Edabit works.