go语言去除字符串空格

package main  

import (  
   "fmt"  
 "strings")  

func main() {  
   text := "        abc       "  
 fmt.Println(strings.TrimSpace(text))  
}  

//结果为:  
//abc

标题:go语言去除字符串空格
作者:老白阳
文章地址:https://www.oldbaiyang.com/articles/2022/05/20/1653056431847.html
-------------------------------------------------------------------------------
老白阳的博客
老白阳的YouTub频道
老白阳的B站频道
老白阳的谷歌博客

Comments

Popular posts from this blog

什么是smart原则

【Protocol Buffer】简介和安装

Novice running training plan: How to run 5 kilometers in 30 minutes?