Rya*_*hel 10 c# string format binary formatting
string binary = Convert.ToString(15, 2);
Console.WriteLine("{0}", binary);
Run Code Online (Sandbox Code Playgroud)
打印:
1111
我想要它打印 00001000
因为数据类型是字符串而不是整数,所以我不能这样做:
Console.WriteLine("{0:00000000}", binary);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11932 次 |
| 最近记录: |