📜  在 c# 代码示例中格式化二进制数

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

代码示例1
int value = 31;
string binary = Convert.ToString(value, 2);
Console.WriteLine(binary.PadLeft(8, '0'));          // Outputs "00011111"