Skip to content
Paul Squires edited this page Oct 19, 2026 · 2 revisions

Home › String Functions › Space

Space

Returns a string of n spaces.

Syntax

Declare Function Space( ByVal count As Integer ) As String

Parameters

  • count

Description

Space creates a string with the specified number of spaces.

Return Value

The created string. An empty string will be returned if count <= 0.

Remarks

Usage

result = Space[$]( count )

Dialect Differences

  • The string type suffix "$" is required in the -lang qb dialect. The string type suffix "$" is optional in the -lang fblite dialect.
    The string type suffix "$" is ignored in the -lang fb dialect, warn only with the -w suffix compile option (or -w pedantic compile option).

Differences from QB

  • None

See also

Examples

Dim a As String

a = "x" + Space(3) + "x"

Print a ' prints: x   x

Category: String Functions
Kind: function


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally