Space Function in VB.NET

How to use the space function in VB.NET?

Explanation

Space Function

Space Function in Visual Basic.net 2008 is used to return a string with the spaces specified as an argument.
Syntax:

Function Space(ByVal Number As Integer) As String

In the above syntax, Number specifies the number of spaces required in the string.
Example:

Module Module1
Sub Main()
Console.WriteLine("World is" & Space(5) & "beautiful")
Console.ReadLine()
End Sub
End Module
Result:

World is
beautiful

In the above example, '5' spaces are included in between two strings using this string function.

Visual Basic Tutorial


Ask Questions

Ask Question