Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个类似于 的十六进制字符串"0xff",并且想将其转换为 int,即 255。
"0xff"
但Int.fromString "0xff"给出了答案0。
Int.fromString "0xff"
0
我虽然这Int.scan会有所帮助。但我是 SML 的新手。
Int.scan
你可以做
StringCvt.scanString (Int.scan StringCvt.HEX) "0xff"
或者
StringCvt.scanString (Int.scan StringCvt.HEX) "ff"