字符串转数字
package main import ( "fmt" "strconv" ) func main() { s := "100" s1, _ := strconv.Atoi(s) fmt.Println(s1) }
数字转字符串
package main import ( "fmt" "strconv" ) func main() { x := 200 s :=strconv.Itoa(x) fmt.Println(s) }
原文链接:https://blog.csdn.net/qq_42410605/article/details/112677904