Go 判断字符串是不是数字

4 min read

golang判断字符串是不是数字

func IsNum(s string) bool {
	_, err := strconv.ParseFloat(s, 64)
	return err == nil
}