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)
content3 = "PadRight".PadRight(50)
content4 = "PadCenter"
content4 = content4.PadLeft((50 + _
content4.Length) \ 2).PadRight(50)
Console.WriteLine(String.Format("{0}{4}{1}{4}{2}{4}{3}", _
content1, content2, content3, content4, vbNewLine))
End Sub
End Class
|