Public Class Tester
Public Shared Sub Main
Dim content1 As String
Dim content2 As String
Dim content3 As String
Dim content4 As String
content1 = "Not padded"
content2 = "PadLeft".PadLeft(50, "."c)
content3 = "PadRight".PadRight(50, "."c)
content4 = "PadCenter"
content4 = content4.PadLeft((50 + content4.Length) \ 2, _
"."c).PadRight(50, "."c)
Console.WriteLine(String.Format("{0}{4}{1}{4}{2}{4}{3}", _
content1, content2, content3, content4, vbNewLine))
End Sub
End Class
Not padded
...........................................PadLeft
PadRight..........................................
....................PadCenter.....................