📜  C# int 到 hex - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:52.001000             🧑  作者: Mango

代码示例1
int num = 123;
//X can be capital and not capital it specifies if the hex characters should be upper or lowercase
//the number specifies the amount of hex characters
//2X will give you something like A5
string hex = num.ToString("X2");