golangは、文字列の最初と最後のスペースを削除します

str := "  dfghhj  "
str = strings.TrimSpace(str)


おすすめ

転載: blog.csdn.net/weixin_43202081/article/details/109743416