Standard library / strings
strings.TrimRight()
Removes trailing runes in cutset; stops at the first nonmember. Expected stdout: '.go\n'.
Formal Syntax & Structure
go syntaxgo
func TrimRight(s, cutset string) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | string | Input text or sequence. |
| cutset | string | Set of code points to remove from the indicated ends. |
Return Value
string
Removes trailing runes in cutset; stops at the first nonmember.
Working Example
Example Snippetgo
package main
import ( "fmt" "strings")
func main() { fmt.Println(string(strings.TrimRight(".go..", ".")))}