Returns a string consisting of the specified number of spaces.
Public Shared Function Space(ByVal Number As Integer) As String
Exception type | Error number | Condition |
---|---|---|
5 | Number < 0. |
The Space function is useful for formatting output and clearing data in fixed-length strings.
This example uses the Space function to return a string consisting of a specified number of spaces.
Dim MyString As String ' Returns a string with 10 spaces. MyString =Space(
10)
' Inserts 10 spaces between two strings. MyString = "Hello" &Space(
10)
& "World"
SPC Function |