Progress Monitor for IdealProgrammer.com
Take Swift, Intelligent, Massive, Planned, Loving, Effective (S.I.M.P.L.E.) Action to Transform Self into Ideal
Skip Repetitive Navigational Links
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console
Please login
VB.NET PadLeft()
Description:
Illustrates using VB.NET PadLeft() Code Example.
Example Class:
Public Class clsPadLeft Public Sub Main() '**************************************************************************************** ' Example #1: PadLeft(totalWidth [, paddingCharacter]) ' Returns a string that is right-aligned and padded on left with character specified. ' If no padddingCharacter is specified, space is used. totalWidth is total width of column ' This allows you to create a nice straight column even though lengths of text vary. '**************************************************************************************** Console.WriteLine("Example #1: PadLeft(totalWidth [, paddingCharacter]) ") Dim strPadLeftExampleA As String = "This is a test string" Dim strPadLeftExampleB As String = "short" Dim strPadLeftExampleC As String = "longer" ' PadLeft "simple" before "test" Console.WriteLine(strPadLeftExampleA.PadLeft(35)) Console.WriteLine(strPadLeftExampleB.PadLeft(35)) Console.WriteLine(strPadLeftExampleC.PadLeft(35)) 'write blank line to make output easier to read Console.WriteLine() 'Prevent console from closing before you press enter Console.ReadLine() End Sub End Class
Example Module:
Module Module1 Sub Main() Dim myclsPadLeft As New clsPadLeft myclsPadLeft.Main() End Sub End Module
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console