📄 3.2.txt
字号:
Listing 3.2 Specifying a Different Numeric Format by Adding Format Specifiers on a
Parameter Placeholder
using System;
namespace _2_Formatting
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
double[] numArray = {2, 5, 4.5, 45.43, 200000};
// format in lowercase hex
Console.WriteLine( “\n\nHex (lower)\n-----------” );
foreach( double num in numArray )
{
Console.Write( “0x{0:x}\t”, (int) num );
}
// format in uppercase hex
Console.WriteLine( “\n\nHex (upper)\n-----------” );
foreach( double num in numArray )
{
Console.Write( “0x{0:X}\t”, (int) num );
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -