diff --git a/vs4win/Chapter02/Ch02Ex03Numbers/Program.cs b/vs4win/Chapter02/Ch02Ex03Numbers/Program.cs index 5e12b34..6c1168a 100644 --- a/vs4win/Chapter02/Ch02Ex03Numbers/Program.cs +++ b/vs4win/Chapter02/Ch02Ex03Numbers/Program.cs @@ -1,6 +1,7 @@ -WriteLine("--------------------------------------------------------------------------"); +string tableRowSeparator = new string('-', 74); +WriteLine(tableRowSeparator); WriteLine("Type Byte(s) of memory Min Max"); -WriteLine("--------------------------------------------------------------------------"); +WriteLine(tableRowSeparator); WriteLine($"sbyte {sizeof(sbyte),-4} {sbyte.MinValue,30} {sbyte.MaxValue,30}"); WriteLine($"byte {sizeof(byte),-4} {byte.MinValue,30} {byte.MaxValue,30}"); WriteLine($"short {sizeof(short),-4} {short.MinValue,30} {short.MaxValue,30}"); @@ -12,4 +13,4 @@ WriteLine($"ulong {sizeof(ulong),-4} {ulong.MinValue,30} {ulong.MaxValue,30}") WriteLine($"float {sizeof(float),-4} {float.MinValue,30} {float.MaxValue,30}"); WriteLine($"double {sizeof(double),-4} {double.MinValue,30} {double.MaxValue,30}"); WriteLine($"decimal {sizeof(decimal),-4} {decimal.MinValue,30} {decimal.MaxValue,30}"); -WriteLine("--------------------------------------------------------------------------"); +WriteLine(tableRowSeparator); diff --git a/vscode/Chapter02/Ch02Ex03Numbers/Program.cs b/vscode/Chapter02/Ch02Ex03Numbers/Program.cs index 5e12b34..6c1168a 100644 --- a/vscode/Chapter02/Ch02Ex03Numbers/Program.cs +++ b/vscode/Chapter02/Ch02Ex03Numbers/Program.cs @@ -1,6 +1,7 @@ -WriteLine("--------------------------------------------------------------------------"); +string tableRowSeparator = new string('-', 74); +WriteLine(tableRowSeparator); WriteLine("Type Byte(s) of memory Min Max"); -WriteLine("--------------------------------------------------------------------------"); +WriteLine(tableRowSeparator); WriteLine($"sbyte {sizeof(sbyte),-4} {sbyte.MinValue,30} {sbyte.MaxValue,30}"); WriteLine($"byte {sizeof(byte),-4} {byte.MinValue,30} {byte.MaxValue,30}"); WriteLine($"short {sizeof(short),-4} {short.MinValue,30} {short.MaxValue,30}"); @@ -12,4 +13,4 @@ WriteLine($"ulong {sizeof(ulong),-4} {ulong.MinValue,30} {ulong.MaxValue,30}") WriteLine($"float {sizeof(float),-4} {float.MinValue,30} {float.MaxValue,30}"); WriteLine($"double {sizeof(double),-4} {double.MinValue,30} {double.MaxValue,30}"); WriteLine($"decimal {sizeof(decimal),-4} {decimal.MinValue,30} {decimal.MaxValue,30}"); -WriteLine("--------------------------------------------------------------------------"); +WriteLine(tableRowSeparator);