例如,
package mainimport ( "fmt" "strings")func main() { s := "t Hello, Worldn " fmt.Printf("%d %qn", len(s), s) t := strings.TrimSpace(s) fmt.Printf("%d %qn", len(t), t)}
输出:
16 "t Hello, Worldn "12 "Hello, World"
欢迎分享,转载请注明来源:内存溢出
例如,
package mainimport ( "fmt" "strings")func main() { s := "t Hello, Worldn " fmt.Printf("%d %qn", len(s), s) t := strings.TrimSpace(s) fmt.Printf("%d %qn", len(t), t)}
输出:
16 "t Hello, Worldn "12 "Hello, World"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)