How to String Format [closed]

You can use the string.PadRight() method, coupled with determining which of the array of strings is the widest:

var width = line.Max(l => l.Length);
foreach (var l in line)
    Console.WriteLine(l.PadRight(width, '.'));

Browse More Popular Posts

Leave a Comment