DataBasic Reference > Statements and Intrinsic Functions > S > STR Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

STR Function (DataBasic) (m618703+str_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

STR Function

Generates a string value containing a specified number of occurrences of a string.

Syntax

STR(string, times)

Syntax Elements

string is a DataBasic expression that evaluates to a string.

times is the number of occurrences of string to be included in the result.

If times is less than one, a null string is returned.

Comment

For strings containing fewer than ten characters, using a string literal is more efficient than the STR function.

Examples

S = STR('*',12)

Creates a string consisting of 12 asterisks (*) and assigns it to variable S.

PRINT STR('ABC',3)

Prints the string ABCABCABC.

VAR = STR("A",2)
B = "BBB"
C = VAR:B

Assigns the string value AABBB  to variable C.

N = STR("?%?",4)

Assigns the string value ?%??%??%??%?  to variable N.

RealityV15.1 (MoTW) Revision 7Comment on this topic