Go语言十六进制转十进制

Go语言十六进制转十进制

代码Demo

import (
	"fmt"
	"strconv"
	"testing"
)

func Test_1(t *testing.T) {
	s:= "0e"
	if parseUint, err := strconv.ParseUint(s, 16, 32);err != nil {
		panic(err)
	}else{
		fmt.Println(parseUint)
	}
}

打印

=== RUN   Test_1
14
--- PASS: Test_1 (0.00s)
PASS

Process finished with exit code 0

原文地址:https://www.cnblogs.com/Kingram/p/13717714.html