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 PadRight()
Description:
Illustrates using VB.NET PadRight() Code Example.
Example Class:
Public Class clsPadRight Public Sub Main() '**************************************************************************************** ' Example #1: PadRight(totalWidth [, paddingCharacter]) ' Returns a string that is left-aligned and padded on right 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: PadRight(totalWidth [, paddingCharacter]) ") Dim strPadRightExampleA As String = "This is a test string" Dim strPadRightExampleB As String = "short" Dim strPadRightExampleC As String = "longer" ' PadRight "simple" before "test" Console.WriteLine(strPadRightExampleA.PadRight(35) + "next column starts here") Console.WriteLine(strPadRightExampleB.PadRight(35) + "next column starts here") Console.WriteLine(strPadRightExampleC.PadRight(35) + "next column starts here") '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 myclsPadRight As New clsPadRight myclsPadRight.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