REPEAT(3) - [CHARACTER] Repeated string concatenation
result = repeat(string, ncopies)
character(len=len(string)*ncopies) function repeat(string, ncopies)character(len=*),intent(in) :: string integer(kind=**),intent(in) :: ncopies
o a kind designated as ** may be any supported kind for the type o STRING is a scalar character type. o NCOPIES is a scalar integer. o the result is a new scalar of type character of the same kind as
REPEAT(3) concatenates copies of a string.
o STRING : The input string to repeat o NCOPIES : Number of copies to make of STRING, greater than or equal to zero (0).
A new string built up from NCOPIES copies of STRING.
Sample program:
program demo_repeat implicit none write(*,(a)) repeat("^v", 35) ! line break write(*,(a)) repeat("_", 70) ! line break write(*,(a)) repeat("1234567890", 7) ! number line write(*,(a)) repeat(" |", 7) ! end program demo_repeatResults:
> ^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v > ______________________________________________________________________ > 1234567890123456789012345678901234567890123456789012345678901234567890 > | | | | | | |
Fortran 95
Functions that perform operations on character strings:
Fortran intrinsic descriptions (license: MIT) @urbanjost
o ELEMENTAL: ADJUSTL(3), ADJUSTR(3), INDEX(3), SCAN(3), VERIFY(3) o NON-ELEMENTAL: LEN_TRIM(3), LEN(3), REPEAT(3), TRIM(3)
Nemo Release 3.1 | repeat (3fortran) | November 02, 2024 |