TrimRight in Go

Posted by GoDoc
Public (Editable by Users)

TrimRight returns a subslice of s by slicing off all trailing UTF-8-encoded code points that are contained in cutset.

Go
Edit
package main

import (
	"bytes"
	"fmt"
)

func main() {
	fmt.Print(string(bytes.TrimRight([]byte("453gopher8257"), "0123456789")))
}