DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
diegous profile image
diegous

Haskell

middleChars :: String -> String
middleChars = tail . dropLast
            where dropLast (last:[])   = []
                  dropLast (head:tail) = head : (dropLast tail)
Forem Open with the Forem app