String$() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns a string built by repeating a specified character some number of times. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

String$( num_expr, string_expr )

num_expr is a positive smallint numeric expression.

string_expr is a string expression.

Return Value

String

Description

The String$() function returns a string num_expr characters long; this result string consists of num_expr occurrences of the first character from the string_expr string. Thus, the num_expr expression should be a positive smallint value, indicating the desired length of the result (in characters).

Example

Dim filler As String 
filler = String$(5, "ABCDEFGH")
' at this point, filler contains the string "AAAAA" 
' (5 copies of the 1st character from the string)

See Also:

Space$() function