You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

package main

import (
	"fmt"
	"strconv"
)

func main() {
	s := "123"
	n, err := strconv.Atoi(s)
	if err != nil {
		fmt.Println("转换出错了")
	} else {
		fmt.Println(n)
	}

}

  • No labels