标签:pen spl sed 字符串 rip str div cli 字符
package main import "fmt" func main() { s1 := " hello world 你好 世界 " for { if s1[0] != 32 && s1[len(s1)-1] !=32{ break } if s1[0] == 32{ s1 = s1[1:] } if s1[len(s1)-1] ==32{ s1 = s1[:len(s1) -1] } } fmt.Println(s1) }
标签:pen spl sed 字符串 rip str div cli 字符
原文地址:https://www.cnblogs.com/zach0812/p/12799308.html