Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(in) | :: | self | String to be repeated. |
||
integer, | intent(in) | :: | ncopies | Number of string copies. |
Repeated string.
Concatenates several copies of an input string.
elemental function srepeat_string_string(self, ncopies) result(repeated)
!---------------------------------------------------------------------------------------------------------------------------------
!< Concatenates several copies of an input string.
!---------------------------------------------------------------------------------------------------------------------------------
class(string), intent(in) :: self !< String to be repeated.
integer, intent(in) :: ncopies !< Number of string copies.
type(string) :: repeated !< Repeated string.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
repeated%raw = repeat(string=self%raw, ncopies=ncopies)
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction srepeat_string_string