Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

REPEAT

Transformational Intrinsic Function (Generic): Concatenates several copies of a string.

result = REPEAT (string,ncopies)

string

(Input) Must be scalar and of type character.

ncopies

(Input) Must be scalar and of type integer. It must not be negative.

Results

The result is a scalar of type character and length ncopies x LEN( string). The kind parameter is the same as string. The value of the result is the concatenation of ncopies copies of string.

Example

REPEAT ('S', 3) has the value SSS.

REPEAT ('ABC', 0) has the value of a zero-length string.

The following shows another example:

 CHARACTER(6) str
 str = REPEAT('HO', 3)  ! returns HOHOHO

See Also