VB.NET Padding Strings
Padding String, Padding String in VB.NET
The PadLeft and PadRight methods can be used to pad strings. The PadLeft method right-aligns and pads a string so that its rightmost character is the specified distance from the beginning of the string. The PadRight method left-aligns and pads a string so that its rightmost character is a specified distance from the end of the string. These methods return new String objects that can either be padded with empty spaces or with custom characters. Listign 3 shows how to use these methods.
Listing 3: Using padding methods
Dim str1 As String = "My String"
Dim str2 As String = "My String"
The output of Listing 3 is shown in Figure given below:
Hope this article would have helped you in understanding Padding String in VB.NET.