DEV Community

Discussion on: Daily Challenge #1 - String Peeler

Collapse
 
cloudyhug profile image
cloudyhug

Haskell

removeFirstAndLast :: String -> String
removeFirstAndLast s
  | length s <= 2 = s
  | otherwise     = init $ tail s