LF Fortran 95

REPEAT Function

Description

The REPEAT function concatenates copies of a string.

Syntax

REPEAT (string, ncopies)

Arguments

string is an INTENT(IN) scalar of type CHARACTER

ncopies is an INTENT(IN) scalar non-negative INTEGER.

Result

The result is a scalar of type CHARACTER with length equal to ncopies times the length of string. Its value is equal to the concatenation of ncopies copies of string.

Example

write(*,*) repeat('ho',3) ! writes hohoho