DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
rafaacioly profile image
Rafael Acioly

Go

func strip(content string) (string, error){
    if len(content) <= 2 {
        return "", error.New("invalid length")
    }

    return content[1:len(content)-1], nil
}        
Forem Open with the Forem app