Concatenates several copies of an input string.
type(string) :: astring
astring = 'y'
print "(L1)", astring%repeat('x', 5)//''=='xxxxx'
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CK, len=*), | intent(in) | :: | rstring |
String to be repeated. |
||
integer, | intent(in) | :: | ncopies |
Number of string copies. |
Repeated string.
elemental function srepeat_character_string(rstring, ncopies) result(repeated)
!< Concatenates several copies of an input string.
!<
!<```fortran
!< type(string) :: astring
!< astring = 'y'
!< print "(L1)", astring%repeat('x', 5)//''=='xxxxx'
!<```
!=> T <<<
character(kind=CK, len=*), intent(in) :: rstring !< String to be repeated.
integer, intent(in) :: ncopies !< Number of string copies.
type(string) :: repeated !< Repeated string.
repeated%raw = repeat(string=rstring, ncopies=ncopies)
endfunction srepeat_character_string