CitectVBA Programming Reference > CitectVBA Function Reference > String Functions > Space

Space

Creates a String consisting of the specified number Num of spaces. The Space function is useful for formatting output and clearing data in fixed-length strings.

Syntax

Space(Num)

Num:

An Integer or expression representing a valid numeric value.

Return Value

Returns a Variant containing a String data type.

Related Functions

String

Example

Dim strTest as String
' Returns a string with 10 spaces.
strTest = Space(10)

' Insert 10 spaces between two strings.
strTest = "Hello" & Space(10) & "World"