PadLeft, PadRight and PadCenter : String Pad « Data Type « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Data Type » String Pad 
2.35.2.PadLeft, PadRight and PadCenter
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.Length2).PadRight(50)
        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
2.35.String Pad
2.35.1.String.Pad
2.35.2.PadLeft, PadRight and PadCenter
2.35.3.PadLeft, PadRight and PadCenter with dot
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.