Answers for "Align String with Spaces [C#]"

C#
0

Align String with Spaces [C#]

Console.WriteLine("-------------------------------");
Console.WriteLine("First Name | Last Name  |   Age");
Console.WriteLine("-------------------------------");
Console.WriteLine(String.Format("{0,-10} | {1,-10} | {2,5}", "Bill", "Gates", 51));
Console.WriteLine(String.Format("{0,-10} | {1,-10} | {2,5}", "Edna", "Parker", 114));
Console.WriteLine(String.Format("{0,-10} | {1,-10} | {2,5}", "Johnny", "Depp", 44));
Console.WriteLine("-------------------------------");
Posted by: Guest on December-30-2021

Code answers related to "Align String with Spaces [C#]"

C# Answers by Framework

Browse Popular Code Answers by Language