错误
naive typecasting
import (
"fmt"
)
func main() {
a := 1234
// we want "1234"
fmt.Println(string(a)) // Ӓ
}
正确
strconv
Sprintf
naive typecasting
import (
"fmt"
)
func main() {
a := 1234
// we want "1234"
fmt.Println(string(a)) // Ӓ
}
strconv
Sprintf
本文标题:Converting Integer to String in
本文链接:https://www.haomeiwen.com/subject/fxclcdtx.html
网友评论