Space Example in VB.NET

If you want to return a string that contains the specified numbers of spaces or if you want to append a number with specified number of spaces then below example will help you solve the problem.
You can use below code too if you want to append or add blank spaces to the right of the string or number.

Dim part2 as Integer
Dim part3 As String

part2 = 12345
part3 = part2.ToString() + Space(5)
MsgBox(part3.Length())


Above example will add 5 blank spaces to the number 12345. So the Length of the number is 10 and the messagebox will return 10.

No comments:

Post a Comment