Skip to content

SPACE


Creates a string of a given length filled with spaces (" ")

Syntax

` declare function Space( byval count as integer ) as string

`

Usage

` result = Space$

`

Parameters

count

An integer type specifying the length of the string to be created.

Return Value

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

Description

Space creates a string with the specified number of spaces.

Examples

start GeSHi

vb
Dim a As String
a = "x" + Space(3) + "x"
Print a ' prints: x   x

end GeSHi

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

  • Wspace
  • Spc
  • String (Function)

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft