Answer the question
In order to leave comments, you need to log in
How to remove comma at the end of a line?
Hello. There is a line
(' ' , ' '), (' ' , ' '),
Answer the question
In order to leave comments, you need to log in
To begin with, I would recommend using the official documentation, by the way, it even rises locally.
Packages/strings/func TrimRight, link to TrimRight, package strings - TrimRight
English words that you write in Russian, at least put in double quotes, if you are too lazy to write in eng, this increases the readability of your question and understanding.
It assumes that "(' ' , ' '), (' ' , ' ')," is indeed a string.
package main
import (
"fmt"
"strings"
)
func main() {
var s = "(' ' , ' '), (' ' , ' '),"
fmt.Println(strings.TrimRight(s, ","))
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question