DEV Community

Discussion on: Daily Challenge #1 - String Peeler

Collapse
 
aritdeveloper profile image
Arit Developer

Ruby

def first_last_gone(string)
    return "Invalid Entry" unless string.length > 2
    string.slice!(0)
    string.slice!(-1)
    string
end